Habari\Posts::empty_param PHP Метод

empty_param() публичный статический Метод

Determine whether a parameter supplied to Posts::get() is empty and should be ignored based on its value being comprised only of empty values
public static empty_param ( string | array $param, array $empty_values = [0, 'any'] ) : boolean
$param string | array The parameter values supplied to Posts::get()
$empty_values array An array defining what values are considered empty and ignorable
Результат boolean True if the parameter values contain only empty values, false otherwise
    public static function empty_param($param, $empty_values = array(0, 'any'))
    {
        if (is_array($param)) {
            $intersection = array_intersect($param, $empty_values);
            return count($intersection) == count($param);
        } else {
            return in_array($param, $empty_values, true);
        }
    }