From 4b08ee6704cb3054386f337abbeff1bbd588ae1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Wed, 12 Jul 2023 21:41:54 +0200 Subject: [PATCH] [Finder docs] Add early directory prunning filter support Co-authored-by: Alexis Lefebvre --- components/finder.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/finder.rst b/components/finder.rst index 27dd6709b6d..9f8d5860f9c 100644 --- a/components/finder.rst +++ b/components/finder.rst @@ -329,6 +329,12 @@ it is called with the file as a :class:`Symfony\\Component\\Finder\\SplFileInfo` instance. The file is excluded from the result set if the Closure returns ``false``. +.. versionadded:: 6.4 + +Since Symfony 6.4, a filter can prune directories early, pass ``true`` as the second +parameter for the ``filter()`` method and when the Closure returns ``false`` the deeper +levels will not be traversed. + Sorting Results ---------------