I think `if (!$data)` is enough. It doesn't matter if `$data` is `null`, `false` or an empty array, it's still invalid.