function Finder::depth
Adds tests for the directory depth.
Usage:
$finder->depth('> 1') // the Finder will start matching at level 1. $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point. $finder->depth(['>= 1', '< 3'])
Parameters
string|int|string[]|int[] $levels The depth level expression or an array of depth levels:
Return value
$this
See also
File
-
vendor/
symfony/ finder/ Finder.php, line 124
Class
- Finder
- Finder allows to build rules to find files and directories.
Namespace
Symfony\Component\FinderCode
public function depth(string|int|array $levels) : static {
foreach ((array) $levels as $level) {
$this->depths[] = new NumberComparator($level);
}
return $this;
}