Skip to content

Commit cb2bc0a

Browse files
committed
minor #26396 Improve the documentation of Finder::exclude() (mnapoli)
This PR was merged into the 2.7 branch. Discussion ---------- Improve the documentation of `Finder::exclude()` | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | | License | MIT | Doc PR | Tried to do this and this didn't work: ```php $iterator->in($sourcePath) ->exclude($sourcePath.'/foo'); ``` I read on http://symfony.com/doc/current/components/finder.html that excluded directories need to be relative: ![capture d ecran 2018-03-04 a 16 10 31](https://user-images.githubusercontent.com/720328/36947055-28e47eda-1fc7-11e8-9475-399a3d853169.png) Commits ------- b43aa2d Improve the documentation of `Finder::exclude()`
2 parents 1b97e1e + b43aa2d commit cb2bc0a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Finder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,10 @@ public function size($size)
386386
/**
387387
* Excludes directories.
388388
*
389+
* Directories passed as argument must be relative to the ones defined with the `in()` method. For example:
390+
*
391+
* $finder->in(__DIR__)->exclude('ruby');
392+
*
389393
* @param string|array $dirs A directory path or an array of directories
390394
*
391395
* @return $this

0 commit comments

Comments
 (0)