diff --git a/src/Cache/FileCache.php b/src/Cache/FileCache.php index b07b94f..32ce746 100644 --- a/src/Cache/FileCache.php +++ b/src/Cache/FileCache.php @@ -25,7 +25,7 @@ public function __construct(string $dir) public function load(string $class): ?ClassMetadata { $path = $this->getCachePath($class); - if (!file_exists($path)) { + if (!is_readable($path)) { return null; } @@ -35,7 +35,7 @@ public function load(string $class): ?ClassMetadata return $metadata; } // if the file does not return anything, the return value is integer `1`. - } catch (\ParseError $e) { + } catch (\Error $e) { // ignore corrupted cache }