original_string: public function sort($sort)
      {
          if (null !== $sort && !is_array($sort)) {
              throw new \InvalidArgumentException(sprintf('The sort "%s" is not valid.', $sort));
          }
  
          $this->sort = $sort;
  
          return $this;
      }
code: public function sort($sort)
      {
          if (null !== $sort && !is_array($sort)) {
              throw new \InvalidArgumentException(sprintf('The sort "%s" is not valid.', $sort));
          }
  
          $this->sort = $sort;
  
          return $this;
      }
code_tokens: public function sort ( $ sort ) { if ( null !== $ sort && ! is_array ( $ sort ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The sort "%s" is not valid.' , $ sort ) ) ; } $ this -> sort = $ sort ; return $ this ; }
docstring: Set the sort.
  
  @param array|null $sort The sort.
  
  @return \Mandango\Query The query instance (fluent interface).
  
  @throws \InvalidArgumentException If the sort is not an array or null.
  
  @api
docstring_tokens: Set the sort .