// verbose information
if ($io->
getVerbosity() === SymfonyStyle::VERBOSITY_VERBOSE
) { $io->
caution('The following files will be deleted:'
);
$io->
listing($thumbnailFiles);
} if (!
$io->
confirm(sprintf('Found %d orphaned thumbnails. Are you sure you want to delete the files? This step is irreversible.', \
count($thumbnailFiles)))) { return;
} $deletedThumbnails =
$this->
deleteThumbnails($io,
$filesystem,
$thumbnailFiles);
$io->
success(sprintf('Removed %d/%d orphaned thumbnails.',
$deletedThumbnails, \
count($thumbnailFiles)));
} private function processFilesIn(string
$directory, FilesystemInterface
$filesystem, ProgressBar
$progressBar): void
{ $contents =
$filesystem->
listContents($directory);
foreach ($contents as $item) { if ($item['type'
] === 'dir'
) { $this->
processFilesIn($item['path'
],
$filesystem,
$progressBar);
}