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
        }
    }
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
        }
    }
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 } }
Cleanup anything that is obsolete now.

@param OutputInterface $output           The output to use.

@param string          $language         The language string.

@param string[]        $destinationFiles The list of destination files.

@return void
Cleanup anything that is obsolete now .