private function clear($directory, OutputInterface $output)
    {
        $handle = opendir($directory);
        $ignore = ['.', '..', '.gitkeep'];
        while ($file = readdir($handle)) {
            if (!in_array($file, $ignore)) {
                $output->writeln("Clearing file {$file} from the cache");
                unlink($directory.$file);
            }
        }
    }
private function clear($directory, OutputInterface $output)
    {
        $handle = opendir($directory);
        $ignore = ['.', '..', '.gitkeep'];
        while ($file = readdir($handle)) {
            if (!in_array($file, $ignore)) {
                $output->writeln("Clearing file {$file} from the cache");
                unlink($directory.$file);
            }
        }
    }
private function clear ( $ directory , OutputInterface $ output ) { $ handle = opendir ( $ directory ) ; $ ignore = [ '.' , '..' , '.gitkeep' ] ; while ( $ file = readdir ( $ handle ) ) { if ( ! in_array ( $ file , $ ignore ) ) { $ output -> writeln ( "Clearing file {$file} from the cache" ) ; unlink ( $ directory . $ file ) ; } } }
Handles clearning out files from given location.

@param string                                            $directory
@param \Symfony\Component\Console\Output\OutputInterface $output

@return void
Handles clearning out files from given location .