original_string: protected function parseSort($sort)
      {
          $type = substr($sort, 0, 1);
          $key = substr($sort, 1);
  
          switch ($type) {
              case '+': $type = Sort::TYPE_ASC; break;
              case '-': $type = Sort::TYPE_DESC; break;
              default:
                  throw new NoSuchSortException();
          }
  
          return new Sort($type, $key);
      }
code: protected function parseSort($sort)
      {
          $type = substr($sort, 0, 1);
          $key = substr($sort, 1);
  
          switch ($type) {
              case '+': $type = Sort::TYPE_ASC; break;
              case '-': $type = Sort::TYPE_DESC; break;
              default:
                  throw new NoSuchSortException();
          }
  
          return new Sort($type, $key);
      }
code_tokens: protected function parseSort ( $ sort ) { $ type = substr ( $ sort , 0 , 1 ) ; $ key = substr ( $ sort , 1 ) ; switch ( $ type ) { case '+' : $ type = Sort :: TYPE_ASC ; break ; case '-' : $ type = Sort :: TYPE_DESC ; break ; default : throw new NoSuchSortException ( ) ; } return new Sort ( $ type , $ key ) ; }
docstring: Parse a single sort from a raw query string
  
  @param $sort
  
  @return Sort
  
  @throws NoSuchSortException
docstring_tokens: Parse a single sort from a raw query string