private function filterNestedPaths(Finder $finder, $prepend)
{
$parents = [];
$files = iterator_to_array($finder);
/** @var SplFileInfo $file */
foreach ($files as $key => $file) {
$path = rtrim(strtr($prepend . '/' . $file->getRelativePath(), '\\', '/'), '/');
$chunks = explode('/', $path);
array_pop($chunks);
$parent = implode('/', $chunks);
if (in_array($parent, $parents)) {
$this->rows[] = [sprintf('<fg=yellow;options=bold>%s</>', '\\' === DIRECTORY_SEPARATOR ? 'WARNING' : '!'), $this->webDir . '/' . $path, sprintf('<comment>Skipped because %s will be symlinked.</comment>', $parent)];
unset($files[$key]);
}
$parents[] = $path;
}
return array_values($files);
}