File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff 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+
148159File 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-
321319Custom Filtering
322320~~~~~~~~~~~~~~~~
323321
You can’t perform that action at this time.
0 commit comments