In theory if $query == null then is a missing parameter but if it's empty but not null is an invalid parameter.