class FileFinder implements IteratorAggregate, Countable

Class FileFinder

$finder = FileFinder::create()
     ->files()
     ->name('*.php')
     ->notName('some.php')
     ->in('/path/to/project')
;

foreach($finder as $file) {
     // something ......
}

Constants

ONLY_FILE

ONLY_DIR

IGNORE_VCS_FILES

IGNORE_DOT_FILES

Methods

static FileFinder
create()

No description

static FileFinder
fromArray(array $config)

No description

__construct(string $path, int $flags, bool $ignoreUnreadableDirs = false)

No description

$this
directories()

No description

$this
dirs()

No description

files()

No description

name(string $pattern)

$finder->name('*.php') $finder->name('test.php')

addNames(string|array $patterns)

No description

notName(string $pattern)

No description

addNotNames(string|array $patterns)

No description

path(string $pattern)

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

addPaths(string|array $patterns)

No description

notPath(string $pattern)

No description

addNotPaths(string|array $patterns)

No description

exclude($dirs)

No description

ignoreVCS(bool $ignoreVCS)

No description

ignoreDotFiles(bool $ignoreDotFiles)

No description

followLinks(bool $followLinks)

No description

filter(Closure $closure)

No description

$this
in(string|array $dirs)

No description

inDir(string|array $dirs)

alias of the in()

$this
append(mixed $iterator)

No description

int
count()

No description

bool
isFollowLinks()

No description

getIterator()

Retrieve an external iterator

current()

No description

getChildren()

No description

rewind()

No description

isRewindable()

No description

Details

at line 78
static FileFinder create()

Return Value

FileFinder

at line 87
static FileFinder fromArray(array $config)

Parameters

array $config

Return Value

FileFinder

at line 419
__construct(string $path, int $flags, bool $ignoreUnreadableDirs = false)

Parameters

string $path
int $flags
bool $ignoreUnreadableDirs

at line 119
$this directories()

Return Value

$this

at line 129
$this dirs()

Return Value

$this

at line 139
FileFinder files()

Return Value

FileFinder

at line 153
FileFinder name(string $pattern)

$finder->name('*.php') $finder->name('test.php')

Parameters

string $pattern

Return Value

FileFinder

at line 164
FileFinder addNames(string|array $patterns)

Parameters

string|array $patterns

Return Value

FileFinder

at line 175
FileFinder notName(string $pattern)

Parameters

string $pattern

Return Value

FileFinder

at line 186
FileFinder addNotNames(string|array $patterns)

Parameters

string|array $patterns

Return Value

FileFinder

at line 199
FileFinder path(string $pattern)

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

Parameters

string $pattern

Return Value

FileFinder

at line 210
FileFinder addPaths(string|array $patterns)

Parameters

string|array $patterns

Return Value

FileFinder

at line 221
FileFinder notPath(string $pattern)

Parameters

string $pattern

Return Value

FileFinder

at line 232
FileFinder addNotPaths(string|array $patterns)

Parameters

string|array $patterns

Return Value

FileFinder

at line 243
FileFinder exclude($dirs)

Parameters

$dirs

Return Value

FileFinder

at line 254
FileFinder ignoreVCS(bool $ignoreVCS)

Parameters

bool $ignoreVCS

Return Value

FileFinder

at line 269
FileFinder ignoreDotFiles(bool $ignoreDotFiles)

Parameters

bool $ignoreDotFiles

Return Value

FileFinder

Parameters

bool $followLinks

Return Value

FileFinder

at line 294
FileFinder filter(Closure $closure)

Parameters

Closure $closure

Return Value

FileFinder

at line 305
$this in(string|array $dirs)

Parameters

string|array $dirs

Return Value

$this

at line 317
FileFinder inDir(string|array $dirs)

alias of the in()

Parameters

string|array $dirs

Return Value

FileFinder

at line 328
$this append(mixed $iterator)

Parameters

mixed $iterator

Return Value

$this

at line 350
int count()

Return Value

int

Return Value

bool

at line 368
Iterator|SplFileInfo[] getIterator()

Retrieve an external iterator

Return Value

Iterator|SplFileInfo[] An iterator

at line 434
current()

at line 454
getChildren()

at line 475
rewind()

at line 484
isRewindable()