Sorts the objects in the collection.
public sort ( string | callable $sorter = 'sort', array $options = [] ) : |
||
$sorter | string | callable | The sorter for the data. Either a callable to use as the sort function or a string with the name of a well-known sort function like `'natsort'` or a compare function like `'strcmp'`. Defaults to `'sort'`. |
$options | array | Reserved for future use. |
return | Returns itself. |