protected function cleanupObsoleteFiles(OutputInterface $output, $language, $destinationFiles)
    {
        if ($this->cleanup && ($files = array_diff($this->determinePresentFiles($language), $destinationFiles))) {
            $this->writeln(
                $output,
                sprintf(
                    'the following obsolete files have been found and will get deleted: <info>%s</info>',
                    implode(', ', $files)
                )
            );

            foreach ($files as $file) {
                unlink($this->getDestinationBasePath() . DIRECTORY_SEPARATOR . $language . DIRECTORY_SEPARATOR . $file);
                $this->writelnVerbose($output, sprintf('deleting obsolete file <info>%s</info>', $file));
            }
            // @codingStandardsIgnoreStart - Catch the error when directory is not empty.
            @rmdir($this->getDestinationBasePath() . DIRECTORY_SEPARATOR . $language);
            // @codingStandardsIgnoreEnd
        }
    }