public function depth($levels)
    {
        foreach ((array) $levels as $level) {
            $this->depths[] = new Comparator\NumberComparator($level);
        }

        return $this;
    }
public function depth($levels)
    {
        foreach ((array) $levels as $level) {
            $this->depths[] = new Comparator\NumberComparator($level);
        }

        return $this;
    }
public function depth ( $ levels ) { foreach ( ( array ) $ levels as $ level ) { $ this -> depths [ ] = new Comparator \ NumberComparator ( $ level ) ; } return $ this ; }
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'])

@param string|int|string[]|int[] $levels The depth level expression or an array of depth levels

@return $this

@see DepthRangeFilterIterator
@see NumberComparator
Adds tests for the directory depth .