Skip to content

Commit

Permalink
Merge pull request #167 from Deltachaos/patch-2
Browse files Browse the repository at this point in the history
Fix Invalid argument supplied for foreach() in FileCacheDriver.php
  • Loading branch information
manuelpichler committed Dec 4, 2014
2 parents 6543385 + 73d32f3 commit 1b2b03a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/php/PDepend/Util/Cache/Driver/FileCacheDriver.php
Expand Up @@ -228,8 +228,12 @@ protected function read($file)
public function remove($pattern)
{
$file = $this->getCacheFileWithoutExtension($pattern);
foreach (glob("{$file}*.*") as $f) {
unlink($f);
$glob = glob("{$file}*.*");
// avoid error if we dont find files
if ($glob !== false) {
foreach (glob("{$file}*.*") as $f) {
unlink($f);
}
}
}

Expand Down

0 comments on commit 1b2b03a

Please sign in to comment.