[Finder] Add support for GLOB in dir() #5450

sebastianbergmann opened this Issue Sep 7, 2012 · 1 comment


None yet
2 participants

sebastianbergmann commented Sep 7, 2012

Discussing sebastianbergmann/phpunit#637 with @fabpot revealed that dir() does not support GLOB and should be implemented.

fabpot added a commit that referenced this issue Jan 3, 2013

merged branch jakzal/finder-glob-support (PR #6531)
This PR was merged into the master branch.


29b9611 [Finder] Added support for GLOB patterns in the directories passed to the in() method.


[Finder] Added support for wildcard characters (GLOB patterns)

Added support for wildcard characters in the paths passed to the *in()* method. Each pattern has to resolve to at least one directory, otherwise exception is thrown (just like when path to an invalid directory is passed).

Example usage:

$finder = new \Symfony\Component\Finder\Finder();
$files = $finder->files()

foreach ($files as $file) {

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #5450
Todo: -
License of the code: MIT
Documentation PR: symfony/symfony-docs#2089

fabpot commented Jan 3, 2013

@sebastianbergmann fixed now in 2.2.

@fabpot fabpot closed this Jan 3, 2013

@sebastianbergmann sebastianbergmann referenced this issue in sebastianbergmann/php-code-coverage Jan 5, 2013


Replace File_Iterator with FinderFacade #144

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment