Skip to content

Commit 906e415

Browse files
authored
Finder::path() method matching directories and files
For clarity, adds an example where `path()` is used to match a directory or a file. ref api-platform/core#575 (comment)
1 parent a01f87f commit 906e415

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

components/finder.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ and adding delimiters:
222222
The :method:`Symfony\\Component\\Finder\\Finder::notPath` method excludes files by path::
223223

224224
$finder->notPath('other/dir');
225+
226+
The method :method:`Symfony\\Component\\Finder\\Finder::path` will match both directories and files. For example, the following will match ``foo/bar.yml`` but also ``foo.yml``::
227+
228+
$finder->in(__DIR__)->path('foo')->name('*.yml);
229+
225230

226231
File Size
227232
~~~~~~~~~

0 commit comments

Comments
 (0)