original_string: public function setOperator($operator)
      {
          if (!$operator) {
              $operator = '==';
          }
  
          if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) {
              throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator));
          }
  
          $this->operator = $operator;
      }
code: public function setOperator($operator)
      {
          if (!$operator) {
              $operator = '==';
          }
  
          if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) {
              throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator));
          }
  
          $this->operator = $operator;
      }
code_tokens: public function setOperator ( $ operator ) { if ( ! $ operator ) { $ operator = '==' ; } if ( ! \ in_array ( $ operator , [ '>' , '<' , '>=' , '<=' , '==' , '!=' ] ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Invalid operator "%s".' , $ operator ) ) ; } $ this -> operator = $ operator ; }
docstring: Sets the comparison operator.
  
  @param string $operator A valid operator
  
  @throws \InvalidArgumentException
docstring_tokens: Sets the comparison operator .