original_string: protected static function parseFieldAndOrder($value, $defaultOrder)
      {
          if (preg_match('/^([^,]+)(,(asc|desc))?$/', $value, $match)) {
              return [$match[1], isset($match[3]) ? $match[3] : $defaultOrder];
  
          }
  
          throw new InvalidArgumentException(sprintf('Unable to parse field name or order from "%s"', $value));
      }
code: protected static function parseFieldAndOrder($value, $defaultOrder)
      {
          if (preg_match('/^([^,]+)(,(asc|desc))?$/', $value, $match)) {
              return [$match[1], isset($match[3]) ? $match[3] : $defaultOrder];
  
          }
  
          throw new InvalidArgumentException(sprintf('Unable to parse field name or order from "%s"', $value));
      }
code_tokens: protected static function parseFieldAndOrder ( $ value , $ defaultOrder ) { if ( preg_match ( '/^([^,]+)(,(asc|desc))?$/' , $ value , $ match ) ) { return [ $ match [ 1 ] , isset ( $ match [ 3 ] ) ? $ match [ 3 ] : $ defaultOrder ] ; } throw new InvalidArgumentException ( sprintf ( 'Unable to parse field name or order from "%s"' , $ value ) ) ; }
docstring: Parse query parameter and get field name and order.
  
  @param string $value
  @param string $defaultOrder default sort order if order is not given explicitly in query
  
  @return string[]
  
  @throws InvalidArgumentException when unable to parse field name or order
docstring_tokens: Parse query parameter and get field name and order .