original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: Checks whether the criterion is valid.
  
  @param Criterion $criterion Criterion to check validity
  
  @return boolean
docstring_tokens: Checks whether the criterion is valid .