diff --git a/src/Cache/FileSystemCacheItemPool.php b/src/Cache/FileSystemCacheItemPool.php index de5ef99e1..771c44854 100644 --- a/src/Cache/FileSystemCacheItemPool.php +++ b/src/Cache/FileSystemCacheItemPool.php @@ -32,11 +32,11 @@ public function __construct($options = []) } if (is_dir($this->cachePath)) { - return true; + return; } if (!mkdir($this->cachePath)) { - throw new ErrorException("Cache folde couldn't be created"); + throw new ErrorException("Cache folder couldn't be created"); } } @@ -65,10 +65,6 @@ public function getItems(array $keys = []): iterable $result = []; foreach ($keys as $key) { - if ($this->isValidKey($key)){ - throw new InvalidArgumentException("The key '$key' is not valid. The key should follow the pattern |^[a-zA-Z0-9_\.! ]+$|"); - } - $result[$key] = $this->getItem($key); } @@ -86,7 +82,7 @@ public function hasItem(string $key): bool return false; } - $serializedItem = file_get_contents($this->cacheFilePath($key)); + $serializedItem = file_get_contents($itemPath); return unserialize($serializedItem)->isHit(); }