From 2e332ddce8a4aa2576169f00d8b7cbc26a40e60a Mon Sep 17 00:00:00 2001 From: Antoine Bluchet Date: Tue, 14 Jun 2016 11:04:49 +0200 Subject: [PATCH] `Finder::path()` method matching directories and files For clarity, adds an example where `path()` is used to match a directory or a file. ref https://github.com/api-platform/core/pull/575#issuecomment-225562545 --- components/finder.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/finder.rst b/components/finder.rst index 2a12460031a..81bc96c41a5 100644 --- a/components/finder.rst +++ b/components/finder.rst @@ -223,6 +223,13 @@ The :method:`Symfony\\Component\\Finder\\Finder::notPath` method excludes files $finder->notPath('other/dir'); +The :method:`Symfony\\Component\\Finder\\Finder::path` method matches +both directories and files. For example, the following will match ``foo/bar.yml`` +but also ``foo.yml``:: + + $finder->in(__DIR__)->path('foo')->name('*.yml); + + File Size ~~~~~~~~~