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;
}