Skip to content

Commit fb6317b

Browse files
vicbweaverryan
authored andcommitted
some clarifications
1 parent c92d508 commit fb6317b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

components/finder.rst

+8-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ directories::
2828
$finder->files()->in(__DIR__);
2929

3030
foreach ($finder as $file) {
31+
// Print the absolute path
3132
print $file->getRealpath()."\n";
33+
// Print the relative path to the file, omitting the filename
34+
print $file->getRelativePath()."\n";
35+
// Print the relative path to the file
36+
print $file->getRelativePathname()."\n";
3237
}
3338

3439
The ``$file`` is an instance of :class:`Symfony\\Component\\Finder\\SplFileInfo`
@@ -208,8 +213,9 @@ To restrict the matching file with your own strategy, use
208213
$finder->files()->filter($filter);
209214

210215
The ``filter()`` method takes a Closure as an argument. For each matching file,
211-
it is called with the file as a :phpclass:`SplFileInfo` instance. The file is
212-
excluded from the result set if the Closure returns ``false``.
216+
it is called with the file as a :class:`Symfony\\Component\\Finder\\SplFileInfo`
217+
instance. The file is excluded from the result set if the Closure returns
218+
``false``.
213219

214220
.. _strtotime: http://www.php.net/manual/en/datetime.formats.php
215221
.. _Iterator: http://www.php.net/manual/en/spl.iterators.php

0 commit comments

Comments
 (0)