Skip to content

Commit 92cae4b

Browse files
committed
Reordered a section of the Finder component
1 parent 247f6d7 commit 92cae4b

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

components/finder.rst

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,17 @@ default when looking for files and directories, but you can change this with the
145145

146146
$finder->ignoreVCS(false);
147147

148+
If your project defines a ``.gitignore`` file, you can reuse those rules to
149+
exclude files and directories from the results with the
150+
:method:`Symfony\\Component\\Finder\\Finder::ignoreVCSIgnored` method::
151+
152+
// excludes files/directories matching the .gitignore patterns
153+
$finder->ignoreVCSIgnored(true);
154+
155+
.. versionadded:: 4.3
156+
157+
The ``ignoreVCSIgnored()`` method was introduced in Symfony 4.3.
158+
148159
File Name
149160
~~~~~~~~~
150161

@@ -305,19 +316,6 @@ Restrict by a depth range by chaining calls or passing an array::
305316
// same as above
306317
$finder->depth(['> 2', '< 5']);
307318

308-
Gitignore
309-
~~~~~~~~~
310-
311-
The Finder can follow ``.gitignore`` file rules with the :method:`Symfony\\Component\\Finder\\Finder::ignoreVCSIgnored` method::
312-
313-
$finder->ignoreVCSIgnored(true);
314-
315-
This will exclude files based on ``.gitignore`` rules as git does.
316-
317-
.. versionadded:: 4.3
318-
319-
The ``ignoreVCSIgnored()`` method was introduced in Symfony 4.3.
320-
321319
Custom Filtering
322320
~~~~~~~~~~~~~~~~
323321

0 commit comments

Comments
 (0)