Skip to content

Commit 88c391d

Browse files
committed
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 88c391d

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
@@ -223,6 +223,11 @@ The :method:`Symfony\\Component\\Finder\\Finder::notPath` method excludes files
223223

224224
$finder->notPath('other/dir');
225225

226+
The method :method:`Symfony\\Component\\Finder\\Finder::path` matches 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+
230+
226231
File Size
227232
~~~~~~~~~
228233

0 commit comments

Comments
 (0)