@@ -9,7 +9,7 @@ |
||
9 | 9 | class DirKey implements IKey |
10 | 10 | { |
11 | 11 | /** @var string */ |
12 | - protected static $dir= '/var/cache/wwwcache/'; |
|
12 | + protected static $dir = '/var/cache/wwwcache/'; |
|
13 | 13 | |
14 | 14 | public static function setDir(string $dir): void |
15 | 15 | { |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | public static function removeFromEnd(string $path, string $separator = DIRECTORY_SEPARATOR): string |
20 | 20 | { |
21 | 21 | $signLen = mb_strlen($separator); |
22 | - return ($separator == mb_substr($path, -1 * $signLen)) ? mb_substr($path, 0, -1 * $signLen) : $path ; |
|
22 | + return ($separator == mb_substr($path, -1 * $signLen)) ? mb_substr($path, 0, -1 * $signLen) : $path; |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
@@ -31,6 +31,6 @@ discard block |
||
31 | 31 | public static function removeFromStart(string $path, string $separator = DIRECTORY_SEPARATOR): string |
32 | 32 | { |
33 | 33 | $signLen = mb_strlen($separator); |
34 | - return ($separator == mb_substr($path, 0, $signLen)) ? mb_substr($path, $signLen) : $path ; |
|
34 | + return ($separator == mb_substr($path, 0, $signLen)) ? mb_substr($path, $signLen) : $path; |
|
35 | 35 | } |
36 | 36 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | public function get(string $key) |
53 | 53 | { |
54 | 54 | $content = $this->getStorage()->read($key); |
55 | - return empty($content) ? null : $content ; |
|
55 | + return empty($content) ? null : $content; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | { |
81 | 81 | // safeadd for multithread at any system |
82 | 82 | if ($this->getStorage()->write($key, $value, $expire)) { |
83 | - return ( $value == $this->get($key) ); |
|
83 | + return ($value == $this->get($key)); |
|
84 | 84 | } |
85 | 85 | return false; |
86 | 86 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $keysToDelete = []; |
163 | 163 | foreach ($this->getAllKeys() as $memKey) { |
164 | 164 | $find = strpos($memKey, $prefix); |
165 | - if ((! $inverse && 0 === $find) || ($inverse && (false === $find || 0 !== $find))) { |
|
165 | + if ((!$inverse && 0 === $find) || ($inverse && (false === $find || 0 !== $find))) { |
|
166 | 166 | $keysToDelete[] = $memKey; |
167 | 167 | } |
168 | 168 | } |