@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | ) |
102 | 102 | )->toArray()[0]; |
103 | 103 | |
104 | - $arrayFilterRecursive = static function ($array, callable $callback = null) use (&$arrayFilterRecursive) { |
|
104 | + $arrayFilterRecursive = static function($array, callable $callback = null) use (&$arrayFilterRecursive) { |
|
105 | 105 | $array = $callback($array); |
106 | 106 | |
107 | 107 | if (\is_object($array) || \is_array($array)) { |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | return $array; |
114 | 114 | }; |
115 | 115 | |
116 | - $callback = static function ($item) { |
|
116 | + $callback = static function($item) { |
|
117 | 117 | /** |
118 | 118 | * Remove unserializable properties |
119 | 119 | */ |
120 | 120 | if ($item instanceof UTCDateTime) { |
121 | - return (string)$item; |
|
121 | + return (string) $item; |
|
122 | 122 | } |
123 | 123 | return $item; |
124 | 124 | }; |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | self::DRIVER_CDATE_WRAPPER_INDEX => new UTCDateTime($item->getCreationDate()), |
205 | 205 | ]; |
206 | 206 | } |
207 | - $result = (array)$this->getCollection()->updateOne( |
|
207 | + $result = (array) $this->getCollection()->updateOne( |
|
208 | 208 | ['_id' => $this->getMongoDbItemKey($item)], |
209 | 209 | [ |
210 | 210 | '$set' => $set, |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | $this->database->selectCollection($collectionName) |
274 | 274 | ->createIndex( |
275 | 275 | [self::DRIVER_EDATE_WRAPPER_INDEX => 1], |
276 | - ['expireAfterSeconds' => 0, 'name' => 'auto_expire_index'] |
|
276 | + ['expireAfterSeconds' => 0, 'name' => 'auto_expire_index'] |
|
277 | 277 | ); |
278 | 278 | } |
279 | 279 | |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | if (count($servers) > 0) { |
304 | 304 | $host = array_reduce( |
305 | 305 | $servers, |
306 | - static fn ($carry, $data) => $carry . ($carry === '' ? '' : ',') . $data['host'] . ':' . $data['port'], |
|
306 | + static fn($carry, $data) => $carry . ($carry === '' ? '' : ',') . $data['host'] . ':' . $data['port'], |
|
307 | 307 | '' |
308 | 308 | ); |
309 | 309 | $port = false; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | { |
114 | 114 | $this->assertCacheItemType($item, Item::class); |
115 | 115 | |
116 | - return (bool)$this->instance->setx($item->getEncodedKey(), $this->encode($this->driverPreWrap($item)), $item->getTtl()); |
|
116 | + return (bool) $this->instance->setx($item->getEncodedKey(), $this->encode($this->driverPreWrap($item)), $item->getTtl()); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | { |
126 | 126 | $this->assertCacheItemType($item, Item::class); |
127 | 127 | |
128 | - return (bool)$this->instance->del($item->getEncodedKey()); |
|
128 | + return (bool) $this->instance->del($item->getEncodedKey()); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | protected function driverClear(): bool |
135 | 135 | { |
136 | - return (bool)$this->instance->flushdb('kv'); |
|
136 | + return (bool) $this->instance->flushdb('kv'); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | public function getConfig(): Config |
@@ -78,7 +78,7 @@ |
||
78 | 78 | { |
79 | 79 | $this->assertCacheItemType($item, Item::class); |
80 | 80 | |
81 | - return (bool)$this->instance->set($item->getKey(), $this->encode($this->driverPreWrap($item))); |
|
81 | + return (bool) $this->instance->set($item->getKey(), $this->encode($this->driverPreWrap($item))); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function getStats(): DriverStatistic |
49 | 49 | { |
50 | - $stats = (array)apcu_cache_info(); |
|
50 | + $stats = (array) apcu_cache_info(); |
|
51 | 51 | $date = (new DateTime())->setTimestamp($stats['start_time']); |
52 | 52 | |
53 | 53 | return (new DriverStatistic()) |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | ) |
61 | 61 | ) |
62 | 62 | ->setRawData($stats) |
63 | - ->setSize((int)$stats['mem_size']); |
|
63 | + ->setSize((int) $stats['mem_size']); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | { |
81 | 81 | $this->assertCacheItemType($item, Item::class); |
82 | 82 | |
83 | - return (bool)apcu_store($item->getKey(), $this->driverPreWrap($item), $item->getTtl()); |
|
83 | + return (bool) apcu_store($item->getKey(), $this->driverPreWrap($item), $item->getTtl()); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | { |
108 | 108 | $this->assertCacheItemType($item, Item::class); |
109 | 109 | |
110 | - return (bool)apcu_delete($item->getKey()); |
|
110 | + return (bool) apcu_delete($item->getKey()); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | return @apcu_clear_cache(); |
119 | 119 | } |
120 | 120 | |
121 | - public function getConfig() : Config|ConfigurationOption |
|
121 | + public function getConfig() : Config | ConfigurationOption |
|
122 | 122 | { |
123 | 123 | return $this->config; |
124 | 124 | } |
@@ -142,7 +142,7 @@ |
||
142 | 142 | /** |
143 | 143 | * Allows to dereference char |
144 | 144 | */ |
145 | - $file = preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__);// remove file protocols such as "phar://" etc. |
|
145 | + $file = preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__); // remove file protocols such as "phar://" etc. |
|
146 | 146 | $prefix = $file[0] === DIRECTORY_SEPARATOR ? DIRECTORY_SEPARATOR : ''; |
147 | 147 | return $prefix . implode(DIRECTORY_SEPARATOR, $absolutes); |
148 | 148 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | * |
37 | 37 | * @return array A class map array |
38 | 38 | */ |
39 | - protected static function createClassMap(Iterator|string|array $dir): array |
|
39 | + protected static function createClassMap(Iterator | string | array $dir): array |
|
40 | 40 | { |
41 | 41 | if (\is_string($dir)) { |
42 | 42 | $dir = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir)); |
@@ -58,23 +58,23 @@ |
||
58 | 58 | /** |
59 | 59 | * @return callable|string |
60 | 60 | */ |
61 | - public function getDefaultKeyHashFunction(): callable|string; |
|
61 | + public function getDefaultKeyHashFunction(): callable | string; |
|
62 | 62 | /** |
63 | 63 | * @param callable|string $defaultKeyHashFunction |
64 | 64 | * @return ConfigurationOption |
65 | 65 | * @throws PhpfastcacheInvalidConfigurationException |
66 | 66 | */ |
67 | - public function setDefaultKeyHashFunction(callable|string $defaultKeyHashFunction): static; |
|
67 | + public function setDefaultKeyHashFunction(callable | string $defaultKeyHashFunction): static; |
|
68 | 68 | /** |
69 | 69 | * @return callable|string |
70 | 70 | */ |
71 | - public function getDefaultFileNameHashFunction(): callable|string; |
|
71 | + public function getDefaultFileNameHashFunction(): callable | string; |
|
72 | 72 | /** |
73 | 73 | * @param callable|string $defaultFileNameHashFunction |
74 | 74 | * @return ConfigurationOption |
75 | 75 | * @throws PhpfastcacheInvalidConfigurationException |
76 | 76 | */ |
77 | - public function setDefaultFileNameHashFunction(callable|string $defaultFileNameHashFunction): static; |
|
77 | + public function setDefaultFileNameHashFunction(callable | string $defaultFileNameHashFunction): static; |
|
78 | 78 | |
79 | 79 | /** |
80 | 80 | * @return string |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | public function __construct(...$args) |
62 | 62 | { |
63 | 63 | parent::__construct(...$args); |
64 | - $array =& $this->getArray(); |
|
64 | + $array = & $this->getArray(); |
|
65 | 65 | |
66 | 66 | /** |
67 | 67 | * Detect unwanted keys and throw an exception. |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | /** |
196 | 196 | * @return callable|string |
197 | 197 | */ |
198 | - public function getDefaultKeyHashFunction(): callable|string |
|
198 | + public function getDefaultKeyHashFunction(): callable | string |
|
199 | 199 | { |
200 | 200 | return $this->defaultKeyHashFunction; |
201 | 201 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | * @return ConfigurationOption |
206 | 206 | * @throws PhpfastcacheInvalidConfigurationException |
207 | 207 | */ |
208 | - public function setDefaultKeyHashFunction(callable|string $defaultKeyHashFunction): static |
|
208 | + public function setDefaultKeyHashFunction(callable | string $defaultKeyHashFunction): static |
|
209 | 209 | { |
210 | 210 | if ($defaultKeyHashFunction && !\is_callable($defaultKeyHashFunction) && (\is_string($defaultKeyHashFunction) && !\function_exists($defaultKeyHashFunction))) { |
211 | 211 | throw new PhpfastcacheInvalidConfigurationException('defaultKeyHashFunction must be a valid function name string'); |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | /** |
218 | 218 | * @return callable|string |
219 | 219 | */ |
220 | - public function getDefaultFileNameHashFunction(): callable|string |
|
220 | + public function getDefaultFileNameHashFunction(): callable | string |
|
221 | 221 | { |
222 | 222 | return $this->defaultFileNameHashFunction; |
223 | 223 | } |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | * @return ConfigurationOption |
228 | 228 | * @throws PhpfastcacheInvalidConfigurationException |
229 | 229 | */ |
230 | - public function setDefaultFileNameHashFunction(callable|string $defaultFileNameHashFunction): static |
|
230 | + public function setDefaultFileNameHashFunction(callable | string $defaultFileNameHashFunction): static |
|
231 | 231 | { |
232 | 232 | if (!\is_callable($defaultFileNameHashFunction) && (\is_string($defaultFileNameHashFunction) && !\function_exists($defaultFileNameHashFunction))) { |
233 | 233 | throw new PhpfastcacheInvalidConfigurationException('defaultFileNameHashFunction must be a valid function name string'); |
@@ -356,8 +356,8 @@ discard block |
||
356 | 356 | */ |
357 | 357 | protected function getDefaultSuperGlobalAccessor(): \Closure |
358 | 358 | { |
359 | - return \Closure::fromCallable(static function (string $superGlobalName, ?string $keyName = null) { |
|
360 | - return match ($superGlobalName) { |
|
359 | + return \Closure::fromCallable(static function(string $superGlobalName, ?string $keyName = null) { |
|
360 | + return match($superGlobalName) { |
|
361 | 361 | 'SERVER' => $keyName !== null ? $_SERVER[$keyName] ?? null : $_SERVER, |
362 | 362 | 'REQUEST' => $keyName !== null ? $_REQUEST[$keyName] ?? null : $_REQUEST, |
363 | 363 | 'COOKIE' => $keyName !== null ? $_COOKIE[$keyName] ?? null : $_COOKIE, |
@@ -140,7 +140,7 @@ |
||
140 | 140 | */ |
141 | 141 | public function unbindAllEventCallbacks(): bool |
142 | 142 | { |
143 | - $this->events = [ |
|
143 | + $this->events = [ |
|
144 | 144 | self::ON_EVERY_EVENT => [] |
145 | 145 | ]; |
146 | 146 |