Bolt\Filesystem\Plugin\Parents::handle PHP Method

handle() public method

public handle ( string $path ) : Bolt\Filesystem\Handler\DirectoryInterface[]
$path string
return Bolt\Filesystem\Handler\DirectoryInterface[]
    public function handle($path)
    {
        $parents = [];
        // path could actually be a file, but it doesn't matter here.
        $dir = $this->filesystem->getDir($path);
        if ($dir->isRoot()) {
            return $parents;
        }
        do {
            $dir = $dir->getParent();
            $parents[] = $dir;
        } while (!$dir->isRoot());
        return $parents;
    }