Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dd2049a

Browse files
committed
[#1527] Tweaks to new Finder::path and Finder::notPath docs
1 parent 198f924 commit dd2049a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

components/finder.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,27 +181,29 @@ Path
181181
~~~~
182182

183183
.. versionadded:: 2.2
184-
Methods ``path()`` and ``notPath()`` have been
185-
introduced in version 2.2.
184+
The ``path()`` and ``notPath()`` methods were added in version 2.2.
186185

187186
Restrict files and directories by path with the
188187
:method:`Symfony\\Component\\Finder\\Finder::path` method::
189188

190189
$finder->path('some/special/dir');
191190

192-
On all platforms slash (i.e. ``/``) should be used as a separator.
191+
On all platforms slash (i.e. ``/``) should be used as the directory separator.
193192

194-
The ``path()`` method accepts strings or regexes::
193+
The ``path()`` method accepts a string or a regular expression::
195194

196195
$finder->path('foo/bar');
197196
$finder->path('/^foo\/bar/');
198197

199-
Strings are converted into regexes by escaping slashes and adding delimiters:
198+
Internally, strings are converted into regular expressions by escaping slashes
199+
and adding delimiters:
200+
201+
.. code-block:: text
200202
201203
dirname ===> /dirname/
202204
a/b/c ===> /a\/b\/c/
203205
204-
The ``notPath()`` method excludes files by path::
206+
The :method:`Symfony\\Component\\Finder\\Finder::notPath` method excludes files by path::
205207

206208
$finder->notPath('other/dir');
207209

0 commit comments

Comments
 (0)