original_string: public function order($orderFlag, $dir = 'desc')
      {
          if (!in_array($orderFlag, static::$orderCriteria)) {
              throw new InvalidArgumentException("Invalid order criteria '{$orderFlag}'");
          }
  
          $this->order = $orderFlag;
          $this->orderDir = strtolower($dir) === 'asc' ? 0 : 1;
  
          return $this;
      }
code: public function order($orderFlag, $dir = 'desc')
      {
          if (!in_array($orderFlag, static::$orderCriteria)) {
              throw new InvalidArgumentException("Invalid order criteria '{$orderFlag}'");
          }
  
          $this->order = $orderFlag;
          $this->orderDir = strtolower($dir) === 'asc' ? 0 : 1;
  
          return $this;
      }
code_tokens: public function order ( $ orderFlag , $ dir = 'desc' ) { if ( ! in_array ( $ orderFlag , static :: $ orderCriteria ) ) { throw new InvalidArgumentException ( "Invalid order criteria '{$orderFlag}'" ) ; } $ this -> order = $ orderFlag ; $ this -> orderDir = strtolower ( $ dir ) === 'asc' ? 0 : 1 ; return $ this ; }
docstring: Set sorting order.
  
  imap_sort only allows one sort condition http://php.net/manual/en/function.imap-sort.php
  Calling again will overwrite previous
  
  @param  int $orderFlag
  @param  string $dir
  @return $this
docstring_tokens: Set sorting order .