protected function isCriterionValid(Criterion $criterion): bool
    {
        $isMultipleOperator = (is_array($criterion->value) || $criterion->value instanceof Collection) &&
            in_array($criterion->operator, $this->multipleOperators);
        $isSingleOperator = is_string($criterion->value) && in_array(strtolower($criterion->operator), $this->singleOperators);

        return is_string($criterion->attribute) &&
            is_string($criterion->boolean) &&
            ($isMultipleOperator || $isSingleOperator);
    }
protected function isCriterionValid(Criterion $criterion): bool
    {
        $isMultipleOperator = (is_array($criterion->value) || $criterion->value instanceof Collection) &&
            in_array($criterion->operator, $this->multipleOperators);
        $isSingleOperator = is_string($criterion->value) && in_array(strtolower($criterion->operator), $this->singleOperators);

        return is_string($criterion->attribute) &&
            is_string($criterion->boolean) &&
            ($isMultipleOperator || $isSingleOperator);
    }
protected function isCriterionValid ( Criterion $ criterion ) : bool { $ isMultipleOperator = ( is_array ( $ criterion -> value ) || $ criterion -> value instanceof Collection ) && in_array ( $ criterion -> operator , $ this -> multipleOperators ) ; $ isSingleOperator = is_string ( $ criterion -> value ) && in_array ( strtolower ( $ criterion -> operator ) , $ this -> singleOperators ) ; return is_string ( $ criterion -> attribute ) && is_string ( $ criterion -> boolean ) && ( $ isMultipleOperator || $ isSingleOperator ) ; }
Checks whether the criterion is valid.

@param Criterion $criterion Criterion to check validity

@return boolean
Checks whether the criterion is valid .