@@ -210,7 +210,7 @@ |
||
210 | 210 | } |
211 | 211 | |
212 | 212 | /** |
213 | - * @param $cacheFile |
|
213 | + * @param string $cacheFile |
|
214 | 214 | * |
215 | 215 | * @return bool |
216 | 216 | */ |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace voku\cache; |
6 | 6 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $this->serializer = new SerializerIgbinary(); |
43 | 43 | |
44 | 44 | if (!$cacheDir) { |
45 | - $cacheDir = \realpath(\sys_get_temp_dir()) . '/simple_php_cache'; |
|
45 | + $cacheDir = \realpath(\sys_get_temp_dir()).'/simple_php_cache'; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | $this->cacheDir = (string)$cacheDir; |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | */ |
259 | 259 | protected function getFileName(string $key): string |
260 | 260 | { |
261 | - return $this->cacheDir . DIRECTORY_SEPARATOR . self::CACHE_FILE_PREFIX . $key . self::CACHE_FILE_SUBFIX; |
|
261 | + return $this->cacheDir.DIRECTORY_SEPARATOR.self::CACHE_FILE_PREFIX.$key.self::CACHE_FILE_SUBFIX; |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | /** |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace voku\cache; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace voku\cache\Exception; |
6 | 6 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace voku\cache; |
6 | 6 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | { |
96 | 96 | // Make sure we are under the proper limit |
97 | 97 | if (\strlen($key) > 250) { |
98 | - throw new InvalidArgumentException('The passed cache key is over 250 bytes:' . print_r($key, true)); |
|
98 | + throw new InvalidArgumentException('The passed cache key is over 250 bytes:'.print_r($key, true)); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | return $this->memcache->set($key, $value, $this->getCompressedFlag()); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace voku\cache; |
6 | 6 | |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | public function set(string $key, $value): bool |
92 | 92 | { |
93 | 93 | // Make sure we are under the proper limit |
94 | - if (\strlen($this->memcached->getOption(\Memcached::OPT_PREFIX_KEY) . $key) > 250) { |
|
95 | - throw new InvalidArgumentException('The passed cache key is over 250 bytes:' . print_r($key, true)); |
|
94 | + if (\strlen($this->memcached->getOption(\Memcached::OPT_PREFIX_KEY).$key) > 250) { |
|
95 | + throw new InvalidArgumentException('The passed cache key is over 250 bytes:'.print_r($key, true)); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | return $this->memcached->set($key, $value); |
@@ -256,10 +256,10 @@ |
||
256 | 256 | protected function getTheDefaultPrefix() |
257 | 257 | { |
258 | 258 | return ($_SERVER['SERVER_NAME'] ?? '') . '_' . |
259 | - ($_SERVER['THEME'] ?? '') . '_' . |
|
260 | - ($_SERVER['STAGE'] ?? '') . '_' . |
|
261 | - ($_SESSION['language'] ?? '') . '_' . |
|
262 | - ($_SESSION['language_extra'] ?? ''); |
|
259 | + ($_SERVER['THEME'] ?? '') . '_' . |
|
260 | + ($_SERVER['STAGE'] ?? '') . '_' . |
|
261 | + ($_SESSION['language'] ?? '') . '_' . |
|
262 | + ($_SESSION['language_extra'] ?? ''); |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | /** |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace voku\cache; |
6 | 6 | |
@@ -255,10 +255,10 @@ discard block |
||
255 | 255 | */ |
256 | 256 | protected function getTheDefaultPrefix() |
257 | 257 | { |
258 | - return ($_SERVER['SERVER_NAME'] ?? '') . '_' . |
|
259 | - ($_SERVER['THEME'] ?? '') . '_' . |
|
260 | - ($_SERVER['STAGE'] ?? '') . '_' . |
|
261 | - ($_SESSION['language'] ?? '') . '_' . |
|
258 | + return ($_SERVER['SERVER_NAME'] ?? '').'_'. |
|
259 | + ($_SERVER['THEME'] ?? '').'_'. |
|
260 | + ($_SERVER['STAGE'] ?? '').'_'. |
|
261 | + ($_SESSION['language'] ?? '').'_'. |
|
262 | 262 | ($_SESSION['language_extra'] ?? ''); |
263 | 263 | } |
264 | 264 | |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | */ |
512 | 512 | protected function calculateStoreKey(string $rawKey): string |
513 | 513 | { |
514 | - $str = $this->getPrefix() . $rawKey; |
|
514 | + $str = $this->getPrefix().$rawKey; |
|
515 | 515 | |
516 | 516 | if ($this->adapter instanceof AdapterFile) { |
517 | 517 | $str = $this->cleanStoreKey($str); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace voku\cache; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace voku\cache; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace voku\cache; |
6 | 6 |