@@ -24,7 +24,7 @@ |
||
24 | 24 | * |
25 | 25 | * @param string $id The id of the cache entry to fetch. |
26 | 26 | * |
27 | - * @return mixed The cached data or FALSE, if no cache entry exists for the given id. |
|
27 | + * @return string|false The cached data or FALSE, if no cache entry exists for the given id. |
|
28 | 28 | */ |
29 | 29 | public function fetch($id) |
30 | 30 | { |
@@ -43,11 +43,9 @@ discard block |
||
43 | 43 | { |
44 | 44 | try { |
45 | 45 | return $this->fileSystem->readFile($path); |
46 | - } |
|
47 | - catch (InvalidPathException $e) { |
|
46 | + } catch (InvalidPathException $e) { |
|
48 | 47 | throw new CacheInvalidPathException('', 0, $e); |
49 | - } |
|
50 | - catch (FileNotFoundException $e) { |
|
48 | + } catch (FileNotFoundException $e) { |
|
51 | 49 | throw new CacheFileNotFoundException('', 0, $e); |
52 | 50 | } |
53 | 51 | } |
@@ -60,11 +58,9 @@ discard block |
||
60 | 58 | { |
61 | 59 | try { |
62 | 60 | $this->fileSystem->writeFile($path, $content); |
63 | - } |
|
64 | - catch (InvalidPathException $e) { |
|
61 | + } catch (InvalidPathException $e) { |
|
65 | 62 | throw new CacheInvalidPathException('', 0, $e); |
66 | - } |
|
67 | - catch (PathAlreadyExistsException $e) { |
|
63 | + } catch (PathAlreadyExistsException $e) { |
|
68 | 64 | throw new CachePathAlreadyExistsException('', 0, $e); |
69 | 65 | } |
70 | 66 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function fetch(string $id): string |
78 | 78 | { |
79 | - if (! $this->contains($id)) { |
|
79 | + if (!$this->contains($id)) { |
|
80 | 80 | $this->misses++; |
81 | 81 | |
82 | 82 | throw new CacheItemNotFoundException(); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | public function contains(string $id): bool |
90 | 90 | { |
91 | - if (! array_key_exists($id, $this->cache)) { |
|
91 | + if (!array_key_exists($id, $this->cache)) { |
|
92 | 92 | return false; |
93 | 93 | } |
94 | 94 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | private function pack() |
145 | 145 | { |
146 | - if (! $this->persistent) { |
|
146 | + if (!$this->persistent) { |
|
147 | 147 | return null; |
148 | 148 | } |
149 | 149 | |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | |
165 | 165 | private function unpack(): array |
166 | 166 | { |
167 | - if (! $this->persistent || ! $this->fileSystem->fileExists($this->cacheFilePath)) { |
|
167 | + if (!$this->persistent || !$this->fileSystem->fileExists($this->cacheFilePath)) { |
|
168 | 168 | return []; |
169 | 169 | } |
170 | 170 |