Puli\Repository\JsonRepository::getPathDepth PHP Метод

getPathDepth() приватный Метод

The depth is used in order to limit the recursion when recursively iterating directories. The depth starts at 0 for the root: 0 webmozart 1 webmozart/puli 2 ...
private getPathDepth ( string $path ) : integer
$path string A Puli path.
Результат integer The depth starting with 0 for the root node.
    private function getPathDepth($path)
    {
        // / has depth 0
        // /webmozart has depth 1
        // /webmozart/puli has depth 2
        // ...
        return substr_count(rtrim($path, '/'), '/');
    }