Skip to content

Commit 2e332dd

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 2e332dd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

components/finder.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,13 @@ The :method:`Symfony\\Component\\Finder\\Finder::notPath` method excludes files
223223

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

226+
The :method:`Symfony\\Component\\Finder\\Finder::path` method matches
227+
both directories and files. For example, the following will match ``foo/bar.yml``
228+
but also ``foo.yml``::
229+
230+
$finder->in(__DIR__)->path('foo')->name('*.yml);
231+
232+
226233
File Size
227234
~~~~~~~~~
228235

0 commit comments

Comments
 (0)