Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions components/finder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@ You can also define your own sorting algorithm with ``sort()`` method::
return strcmp($a->getRealPath(), $b->getRealPath());
});

You can reverse any sorting by using the ``reverseSorting()`` method::

$finder->sortByName()->reverseSorting();

.. versionadded:: 4.2
The ``reverseSorting()`` method to reverse the sort order was introduced in Symfony 4.2.

.. note::

Notice that the ``sort*`` methods need to get all matching elements to do
Expand Down