@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | public function clear(string $namespace = null) : bool |
| 166 | 166 | { |
| 167 | 167 | $dir = $this->getBasePath($namespace); |
| 168 | - $files = $this->streamSafeGlob($dir, '*.cache'.self::JSON_FORMAT); |
|
| 168 | + $files = $this->streamSafeGlob($dir, '*.cache' . self::JSON_FORMAT); |
|
| 169 | 169 | foreach ($files as $file) { |
| 170 | 170 | if (is_file($file)) { |
| 171 | 171 | if (!unlink($file)) { |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | public function setCacheDirectory(string $cacheDirectory) : bool |
| 188 | 188 | { |
| 189 | 189 | $this->cacheDirectory = null; |
| 190 | - $cacheDirectory = rtrim($cacheDirectory, '//, ').'/'; |
|
| 190 | + $cacheDirectory = rtrim($cacheDirectory, '//, ') . '/'; |
|
| 191 | 191 | if (!((file_exists($cacheDirectory) && is_writable($cacheDirectory)) || @mkdir($cacheDirectory, 0755, true))) { |
| 192 | 192 | $this->setLastError(new Exception("Failed to use $cacheDirectory as cache directory.")); |
| 193 | 193 | |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | */ |
| 218 | 218 | private function getFilePath(string $key) : string |
| 219 | 219 | { |
| 220 | - return $this->getBasePath($this->namespace).$key.'.cache'.self::JSON_FORMAT; |
|
| 220 | + return $this->getBasePath($this->namespace) . $key . '.cache' . self::JSON_FORMAT; |
|
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | /** |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | */ |
| 228 | 228 | private function getBasePath(string $namespace = null) : string |
| 229 | 229 | { |
| 230 | - return $this->cacheDirectory.(!empty($namespace) ? $namespace.DIRECTORY_SEPARATOR : ''); |
|
| 230 | + return $this->cacheDirectory . (!empty($namespace) ? $namespace . DIRECTORY_SEPARATOR : ''); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | /** |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | // Find all keys, iterate and them delete the only ones that starts with the namespace |
| 145 | 145 | $cacheKeys = $this->memcachedInstance->getAllKeys(); |
| 146 | - $filteredCacheKeys = array_filter($cacheKeys, function ($key) use ($namespace) { |
|
| 146 | + $filteredCacheKeys = array_filter($cacheKeys, function($key) use ($namespace) { |
|
| 147 | 147 | return strpos($key, $namespace) === 0; |
| 148 | 148 | }); |
| 149 | 149 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | private function namespacedKey(string $key) : string |
| 164 | 164 | { |
| 165 | 165 | if ($this->namespace !== null) { |
| 166 | - return $this->namespace.$key; |
|
| 166 | + return $this->namespace . $key; |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | return $key; |