original_string: public static function sortDocumentsByField($documents, $field, $order = 'ASC')
      {
          self::$orderByField = $field;
          self::$order = strtoupper($order) === 'ASC' ? 'ASC' : 'DESC';
          usort($documents, '\CloudControl\Cms\util\DocumentSorter::fieldCompare');
          if ($order === 'DESC') {
              return array_reverse($documents);
          }
          return $documents;
      }
code: public static function sortDocumentsByField($documents, $field, $order = 'ASC')
      {
          self::$orderByField = $field;
          self::$order = strtoupper($order) === 'ASC' ? 'ASC' : 'DESC';
          usort($documents, '\CloudControl\Cms\util\DocumentSorter::fieldCompare');
          if ($order === 'DESC') {
              return array_reverse($documents);
          }
          return $documents;
      }
code_tokens: public static function sortDocumentsByField ( $ documents , $ field , $ order = 'ASC' ) { self :: $ orderByField = $ field ; self :: $ order = strtoupper ( $ order ) === 'ASC' ? 'ASC' : 'DESC' ; usort ( $ documents , '\CloudControl\Cms\util\DocumentSorter::fieldCompare' ) ; if ( $ order === 'DESC' ) { return array_reverse ( $ documents ) ; } return $ documents ; }
docstring: Sorts an array of Document instances
  @param array $documents
  @param string $field
  @param string $order
  @return array
docstring_tokens: Sorts an array of Document instances