original_string: protected function validate(array $values, $operator)
      {
          if (!in_array($operator, array('=', '!='))) {
              return $this->translation->text('Unsupported operator');
          }
  
          if (count($values) != 1) {
              return $this->translation->text('@field has invalid value', array(
                  '@field' => $this->translation->text('Condition')));
          }
  
          $scope = filter_var(reset($values), FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
  
          if (!isset($scope)) {
              return $this->translation->text('@field has invalid value', array(
                  '@field' => $this->translation->text('Condition')));
          }
  
          return true;
      }
code: protected function validate(array $values, $operator)
      {
          if (!in_array($operator, array('=', '!='))) {
              return $this->translation->text('Unsupported operator');
          }
  
          if (count($values) != 1) {
              return $this->translation->text('@field has invalid value', array(
                  '@field' => $this->translation->text('Condition')));
          }
  
          $scope = filter_var(reset($values), FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
  
          if (!isset($scope)) {
              return $this->translation->text('@field has invalid value', array(
                  '@field' => $this->translation->text('Condition')));
          }
  
          return true;
      }
code_tokens: protected function validate ( array $ values , $ operator ) { if ( ! in_array ( $ operator , array ( '=' , '!=' ) ) ) { return $ this -> translation -> text ( 'Unsupported operator' ) ; } if ( count ( $ values ) != 1 ) { return $ this -> translation -> text ( '@field has invalid value' , array ( '@field' => $ this -> translation -> text ( 'Condition' ) ) ) ; } $ scope = filter_var ( reset ( $ values ) , FILTER_VALIDATE_BOOLEAN , FILTER_NULL_ON_FAILURE ) ; if ( ! isset ( $ scope ) ) { return $ this -> translation -> text ( '@field has invalid value' , array ( '@field' => $ this -> translation -> text ( 'Condition' ) ) ) ; } return true ; }
docstring: Common scope validator
  @param array $values
  @param string $operator
  @return boolean|string
docstring_tokens: Common scope validator