@@ -302,10 +302,10 @@ |
||
302 | 302 | protected function getTheDefaultPrefix(): string |
303 | 303 | { |
304 | 304 | return ($_SERVER['SERVER_NAME'] ?? '') . '_' . |
305 | - ($_SERVER['THEME'] ?? '') . '_' . |
|
306 | - ($_SERVER['STAGE'] ?? '') . '_' . |
|
307 | - ($_SESSION['language'] ?? '') . '_' . |
|
308 | - ($_SESSION['language_extra'] ?? ''); |
|
305 | + ($_SERVER['THEME'] ?? '') . '_' . |
|
306 | + ($_SERVER['STAGE'] ?? '') . '_' . |
|
307 | + ($_SESSION['language'] ?? '') . '_' . |
|
308 | + ($_SESSION['language_extra'] ?? ''); |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | /** |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | */ |
253 | 253 | protected function calculateStoreKey(string $rawKey): string |
254 | 254 | { |
255 | - $str = $this->getPrefix() . $rawKey; |
|
255 | + $str = $this->getPrefix().$rawKey; |
|
256 | 256 | |
257 | 257 | if ($this->adapter instanceof AdapterFileAbstract) { |
258 | 258 | $str = $this->cleanStoreKey($str); |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | } else { |
276 | 276 | |
277 | 277 | // for testing with dev-address |
278 | - $noDev = isset($_GET['noDev']) ? (int) $_GET['noDev'] : 0; |
|
278 | + $noDev = isset($_GET['noDev']) ? (int)$_GET['noDev'] : 0; |
|
279 | 279 | $remoteAddr = $_SERVER['REMOTE_ADDR'] ?? 'NO_REMOTE_ADDR'; |
280 | 280 | |
281 | 281 | if ( |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | } |
501 | 501 | |
502 | 502 | // always cache the TTL time, maybe we need this later ... |
503 | - self::$STATIC_CACHE_EXPIRE[$storeKey] = ($ttl ? (int) $ttl + \time() : 0); |
|
503 | + self::$STATIC_CACHE_EXPIRE[$storeKey] = ($ttl ? (int)$ttl + \time() : 0); |
|
504 | 504 | |
505 | 505 | return $this->adapter->setExpired($storeKey, $serialized, $ttl); |
506 | 506 | } |
@@ -598,10 +598,10 @@ discard block |
||
598 | 598 | */ |
599 | 599 | protected function getTheDefaultPrefix(): string |
600 | 600 | { |
601 | - return ($_SERVER['SERVER_NAME'] ?? '') . '_' . |
|
602 | - ($_SERVER['THEME'] ?? '') . '_' . |
|
603 | - ($_SERVER['STAGE'] ?? '') . '_' . |
|
604 | - ($_SESSION['language'] ?? '') . '_' . |
|
601 | + return ($_SERVER['SERVER_NAME'] ?? '').'_'. |
|
602 | + ($_SERVER['THEME'] ?? '').'_'. |
|
603 | + ($_SERVER['STAGE'] ?? '').'_'. |
|
604 | + ($_SESSION['language'] ?? '').'_'. |
|
605 | 605 | ($_SESSION['language_extra'] ?? ''); |
606 | 606 | } |
607 | 607 | |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | |
647 | 647 | // test the cache, with this GET-parameter |
648 | 648 | if ($this->disableCacheGetParameter) { |
649 | - $testCache = isset($_GET[$this->disableCacheGetParameter]) ? (int) $_GET[$this->disableCacheGetParameter] : 0; |
|
649 | + $testCache = isset($_GET[$this->disableCacheGetParameter]) ? (int)$_GET[$this->disableCacheGetParameter] : 0; |
|
650 | 650 | } else { |
651 | 651 | $testCache = 0; |
652 | 652 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | /** @noinspection PhpUnhandledExceptionInspection */ |
89 | 89 | $interfaces = (new \ReflectionClass($replaceAdapter))->getInterfaces(); |
90 | 90 | if (!array_key_exists(iAdapter::class, $interfaces)) { |
91 | - throw new InvalidArgumentException('"' . $replaceAdapter . '" did not implement the "iAdapter"-interface [' . print_r($interfaces, true) . ']'); |
|
91 | + throw new InvalidArgumentException('"'.$replaceAdapter.'" did not implement the "iAdapter"-interface ['.print_r($interfaces, true).']'); |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | /** @noinspection PhpUnhandledExceptionInspection */ |
119 | 119 | $cacheAdapterManager->addAdapter( |
120 | 120 | AdapterMemcached::class, |
121 | - function () { |
|
121 | + function() { |
|
122 | 122 | $memcached = null; |
123 | 123 | $isMemcachedAvailable = false; |
124 | 124 | if (\extension_loaded('memcached')) { |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | /** @noinspection PhpUnhandledExceptionInspection */ |
140 | 140 | $cacheAdapterManager->addAdapter( |
141 | 141 | AdapterMemcache::class, |
142 | - function () { |
|
142 | + function() { |
|
143 | 143 | $memcache = null; |
144 | 144 | $isMemcacheAvailable = false; |
145 | 145 | /** @noinspection ClassConstantCanBeUsedInspection */ |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | /** @noinspection PhpUnhandledExceptionInspection */ |
162 | 162 | $cacheAdapterManager->addAdapter( |
163 | 163 | AdapterPredis::class, |
164 | - function () { |
|
164 | + function() { |
|
165 | 165 | $redis = null; |
166 | 166 | $isRedisAvailable = false; |
167 | 167 | if ( |
@@ -216,8 +216,8 @@ discard block |
||
216 | 216 | /** @noinspection PhpUnhandledExceptionInspection */ |
217 | 217 | $cacheAdapterManager->addAdapter( |
218 | 218 | AdapterOpCache::class, |
219 | - function () { |
|
220 | - $cacheDir = \realpath(\sys_get_temp_dir()) . '/simple_php_cache'; |
|
219 | + function() { |
|
220 | + $cacheDir = \realpath(\sys_get_temp_dir()).'/simple_php_cache'; |
|
221 | 221 | |
222 | 222 | return $cacheDir; |
223 | 223 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | public function delete($key): bool |
32 | 32 | { |
33 | 33 | if (!\is_string($key)) { |
34 | - throw new InvalidArgumentException('$key is not a string:' . \print_r($key, true)); |
|
34 | + throw new InvalidArgumentException('$key is not a string:'.\print_r($key, true)); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | return $this->removeItem($key); |
@@ -53,11 +53,11 @@ discard block |
||
53 | 53 | && |
54 | 54 | !($keys instanceof \Traversable) |
55 | 55 | ) { |
56 | - throw new InvalidArgumentException('$keys is not iterable:' . \print_r($keys, true)); |
|
56 | + throw new InvalidArgumentException('$keys is not iterable:'.\print_r($keys, true)); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | $results = []; |
60 | - foreach ((array) $keys as $key) { |
|
60 | + foreach ((array)$keys as $key) { |
|
61 | 61 | $results[] = $this->delete($key); |
62 | 62 | } |
63 | 63 | |
@@ -101,11 +101,11 @@ discard block |
||
101 | 101 | && |
102 | 102 | !($keys instanceof \Traversable) |
103 | 103 | ) { |
104 | - throw new InvalidArgumentException('$keys is not iterable:' . \print_r($keys, true)); |
|
104 | + throw new InvalidArgumentException('$keys is not iterable:'.\print_r($keys, true)); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | $result = []; |
108 | - foreach ((array) $keys as $key) { |
|
108 | + foreach ((array)$keys as $key) { |
|
109 | 109 | $result[$key] = $this->has($key) ? $this->get($key) : $default; |
110 | 110 | } |
111 | 111 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | public function has($key): bool |
130 | 130 | { |
131 | 131 | if (!\is_string($key)) { |
132 | - throw new InvalidArgumentException('$key is not a string:' . \print_r($key, true)); |
|
132 | + throw new InvalidArgumentException('$key is not a string:'.\print_r($key, true)); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | return $this->existsItem($key); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | public function set($key, $value, $ttl = null): bool |
152 | 152 | { |
153 | 153 | if (!\is_string($key)) { |
154 | - throw new InvalidArgumentException('$key is not a string:' . \print_r($key, true)); |
|
154 | + throw new InvalidArgumentException('$key is not a string:'.\print_r($key, true)); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | return $this->setItem($key, $value, $ttl); |
@@ -176,11 +176,11 @@ discard block |
||
176 | 176 | && |
177 | 177 | !($values instanceof \Traversable) |
178 | 178 | ) { |
179 | - throw new InvalidArgumentException('$values is not iterable:' . \print_r($values, true)); |
|
179 | + throw new InvalidArgumentException('$values is not iterable:'.\print_r($values, true)); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | $results = []; |
183 | - foreach ((array) $values as $key => $value) { |
|
183 | + foreach ((array)$values as $key => $value) { |
|
184 | 184 | $results[] = $this->set($key, $value, $ttl); |
185 | 185 | } |
186 | 186 |