Command/CleanAssetsCommand.php
protected function executeDeleteExtra(InputInterface $input, OutputInterface $output)
    {
        /** @var array $extraFiles */
        foreach ($this->extraFiles as $adapterReference => $extraFiles) {
            $count = \count($extraFiles);
            $files = implode(', ', $extraFiles);
            $m = '<error>NO FILE REMOVED : Please use the --force option in non-interactive mode to prevent';
            $m .= ' any mistake</error>';

            $configCodes = [];
            foreach ($this->adaptersByResourceType as $configCode => $adapterRef2) {
                if ($adapterReference === $adapterRef2) {
                    $configCodes[] = $configCode;
                }
            }
            $configs = implode("', '", $configCodes);

            $messages = [
                'no_item' => "<comment>No file to remove in fs '{$configs}'</comment>",
                'info' => "<comment>The following files will be deleted in fs '{$configs}': {$files}</comment>",
                'skipping' => '<comment>Skipping file removal.</comment>',
                'error' => $m,
                'question' => "Are you sure you want to remove {$count} files in fs '{$configs}' ? y/[n]\n",
            ];

            if (!$this->askQuestion($input, $output, $extraFiles, $messages)) {
                continue;
            }

            $adapter = $this->adapters[$adapterReference];
            foreach ($extraFiles as $extraFile) {
                if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE) {
                    $output->writeln("<comment>Removing file {$extraFile}</comment>");
                }
                if (!$input->getOption('simulate') && $adapter->has($extraFile)) {
                    $adapter->delete($extraFile);
                }
            }

            if ($output->getVerbosity() >= OutputInterface::VERBOSITY_NORMAL) {
                $output->writeln("<comment>{$count} files deleted in fs '{$configs}'</comment>");
            }
        }
    }
protected function executeDeleteExtra(InputInterface $input, OutputInterface $output)
    {
        /** @var array $extraFiles */
        foreach ($this->extraFiles as $adapterReference => $extraFiles) {
            $count = \count($extraFiles);
            $files = implode(', ', $extraFiles);
            $m = '<error>NO FILE REMOVED : Please use the --force option in non-interactive mode to prevent';
            $m .= ' any mistake</error>';

            $configCodes = [];
            foreach ($this->adaptersByResourceType as $configCode => $adapterRef2) {
                if ($adapterReference === $adapterRef2) {
                    $configCodes[] = $configCode;
                }
            }
            $configs = implode("', '", $configCodes);

            $messages = [
                'no_item' => "<comment>No file to remove in fs '{$configs}'</comment>",
                'info' => "<comment>The following files will be deleted in fs '{$configs}': {$files}</comment>",
                'skipping' => '<comment>Skipping file removal.</comment>',
                'error' => $m,
                'question' => "Are you sure you want to remove {$count} files in fs '{$configs}' ? y/[n]\n",
            ];

            if (!$this->askQuestion($input, $output, $extraFiles, $messages)) {
                continue;
            }

            $adapter = $this->adapters[$adapterReference];
            foreach ($extraFiles as $extraFile) {
                if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE) {
                    $output->writeln("<comment>Removing file {$extraFile}</comment>");
                }
                if (!$input->getOption('simulate') && $adapter->has($extraFile)) {
                    $adapter->delete($extraFile);
                }
            }

            if ($output->getVerbosity() >= OutputInterface::VERBOSITY_NORMAL) {
                $output->writeln("<comment>{$count} files deleted in fs '{$configs}'</comment>");
            }
        }
    }
@param InputInterface  $input
@param OutputInterface $output

@throws \Symfony\Component\Console\Exception\InvalidArgumentException
@throws \Symfony\Component\Console\Exception\RuntimeException
@throws \Symfony\Component\Console\Exception\LogicException