@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | parent::__construct($directory, $extension, $umask); |
| 45 | 45 | |
| 46 | - self::$emptyErrorHandler = function () { |
|
| 46 | + self::$emptyErrorHandler = function() { |
|
| 47 | 47 | }; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | { |
| 55 | 55 | $value = $this->includeFileForId($id); |
| 56 | 56 | |
| 57 | - if (! $value) { |
|
| 57 | + if ( ! $value) { |
|
| 58 | 58 | return false; |
| 59 | 59 | } |
| 60 | 60 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | $value = $this->includeFileForId($id); |
| 74 | 74 | |
| 75 | - if (! $value) { |
|
| 75 | + if ( ! $value) { |
|
| 76 | 76 | return false; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $lifeTime = time() + $lifeTime; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - $filename = $this->getFilename($id); |
|
| 91 | + $filename = $this->getFilename($id); |
|
| 92 | 92 | |
| 93 | 93 | $value = [ |
| 94 | 94 | 'lifetime' => $lifeTime, |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | restore_error_handler(); |
| 124 | 124 | |
| 125 | - if (! isset($value['lifetime'])) { |
|
| 125 | + if ( ! isset($value['lifetime'])) { |
|
| 126 | 126 | return false; |
| 127 | 127 | } |
| 128 | 128 | |
@@ -69,6 +69,9 @@ discard block |
||
| 69 | 69 | ]; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | + /** |
|
| 73 | + * @param integer $pathLength |
|
| 74 | + */ |
|
| 72 | 75 | private static function getBasePathForWindowsPathLengthTests($pathLength) |
| 73 | 76 | { |
| 74 | 77 | return FileCacheTest::getBasePathForWindowsPathLengthTests($pathLength); |
@@ -78,7 +81,7 @@ discard block |
||
| 78 | 81 | * @param int $length |
| 79 | 82 | * @param string $basePath |
| 80 | 83 | * |
| 81 | - * @return array |
|
| 84 | + * @return string[] |
|
| 82 | 85 | */ |
| 83 | 86 | private static function getKeyAndPathFittingLength($length, $basePath) |
| 84 | 87 | { |
@@ -170,7 +170,7 @@ |
||
| 170 | 170 | * @param int $length |
| 171 | 171 | * @param string $basePath |
| 172 | 172 | * |
| 173 | - * @return array |
|
| 173 | + * @return string[] |
|
| 174 | 174 | */ |
| 175 | 175 | public static function getKeyAndPathFittingLength($length, $basePath) |
| 176 | 176 | { |
@@ -334,7 +334,7 @@ |
||
| 334 | 334 | * |
| 335 | 335 | * @param string $id The id of the cache entry to fetch. |
| 336 | 336 | * |
| 337 | - * @return mixed|false The cached data or FALSE, if no cache entry exists for the given id. |
|
| 337 | + * @return string The cached data or FALSE, if no cache entry exists for the given id. |
|
| 338 | 338 | */ |
| 339 | 339 | abstract protected function doFetch($id); |
| 340 | 340 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | { |
| 121 | 121 | $tagStoredKeys = $this->fetch(self::TAG_PREFIX.$tag); |
| 122 | 122 | |
| 123 | - if (!is_array($tagStoredKeys)) { |
|
| 123 | + if ( ! is_array($tagStoredKeys)) { |
|
| 124 | 124 | $tagStoredKeys = []; |
| 125 | 125 | } |
| 126 | 126 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | public function save($id, $data, $lifeTime = 0, array $tags = []) |
| 164 | 164 | { |
| 165 | - if (!empty($tags)) { |
|
| 165 | + if ( ! empty($tags)) { |
|
| 166 | 166 | $this->updateTagsReferences($id, $tags); |
| 167 | 167 | |
| 168 | 168 | $this->doSave($this->getNamespacedId($id.self::TAG_SUFFIX), $tags, $lifeTime); |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | $tagStoredKeys = $this->fetch($tagKey); |
| 192 | 192 | |
| 193 | - if (!is_array($tagStoredKeys)) { |
|
| 193 | + if ( ! is_array($tagStoredKeys)) { |
|
| 194 | 194 | $tagStoredKeys = []; |
| 195 | 195 | } |
| 196 | 196 | |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | */ |
| 254 | 254 | private function getNamespacedId($id) |
| 255 | 255 | { |
| 256 | - $namespaceVersion = $this->getNamespaceVersion(); |
|
| 256 | + $namespaceVersion = $this->getNamespaceVersion(); |
|
| 257 | 257 | |
| 258 | 258 | return sprintf('%s[%s][%s]', $this->namespace, $id, $namespaceVersion); |
| 259 | 259 | } |
@@ -317,11 +317,11 @@ discard block |
||
| 317 | 317 | |
| 318 | 318 | $tagStoredKeys = $this->fetch($tagKey); |
| 319 | 319 | |
| 320 | - if (!is_array($tagStoredKeys)) { |
|
| 320 | + if ( ! is_array($tagStoredKeys)) { |
|
| 321 | 321 | $tagStoredKeys = []; |
| 322 | 322 | } |
| 323 | 323 | |
| 324 | - if (!isset($tagStoredKeys[$id])) { |
|
| 324 | + if ( ! isset($tagStoredKeys[$id])) { |
|
| 325 | 325 | $tagStoredKeys[$id] = 1; |
| 326 | 326 | } |
| 327 | 327 | |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | $success = true; |
| 362 | 362 | |
| 363 | 363 | foreach ($keysAndValues as $key => $value) { |
| 364 | - if (!$this->doSave($key, $value, $lifetime)) { |
|
| 364 | + if ( ! $this->doSave($key, $value, $lifetime)) { |
|
| 365 | 365 | $success = false; |
| 366 | 366 | } |
| 367 | 367 | } |
@@ -40,7 +40,6 @@ discard block |
||
| 40 | 40 | /** |
| 41 | 41 | * Fetches an entry by tag from the cache. |
| 42 | 42 | * |
| 43 | - * @param string $id The id of the cache entry to fetch. |
|
| 44 | 43 | * |
| 45 | 44 | * @return mixed The cached data or FALSE, if no cache entry exists for the given id. |
| 46 | 45 | */ |
@@ -59,7 +58,8 @@ discard block |
||
| 59 | 58 | /** |
| 60 | 59 | * Deletes a cache entries marked by tags. |
| 61 | 60 | * |
| 62 | - * @param array $tag The tag id's. |
|
| 61 | + * @param array $tags The tag id's. |
|
| 62 | + * @return void |
|
| 63 | 63 | */ |
| 64 | 64 | public function deleteByTags(array $tags = []); |
| 65 | 65 | } |