@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | { |
111 | 111 | $this->assertCacheItemType($item, Item::class); |
112 | 112 | |
113 | - return (bool)$this->instance->setx($item->getEncodedKey(), $this->encode($this->driverPreWrap($item)), $item->getTtl()); |
|
113 | + return (bool) $this->instance->setx($item->getEncodedKey(), $this->encode($this->driverPreWrap($item)), $item->getTtl()); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | { |
123 | 123 | $this->assertCacheItemType($item, Item::class); |
124 | 124 | |
125 | - return (bool)$this->instance->del($item->getEncodedKey()); |
|
125 | + return (bool) $this->instance->del($item->getEncodedKey()); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
@@ -208,7 +208,7 @@ |
||
208 | 208 | * Reset the Item |
209 | 209 | */ |
210 | 210 | $item->set(null) |
211 | - ->expiresAfter(abs((int)$this->getConfig()->getDefaultTtl())) |
|
211 | + ->expiresAfter(abs((int) $this->getConfig()->getDefaultTtl())) |
|
212 | 212 | ->setHit(false) |
213 | 213 | ->setTags([]); |
214 | 214 | if ($this->getConfig()->isItemDetailedDate()) { |
@@ -97,7 +97,7 @@ |
||
97 | 97 | /** |
98 | 98 | * CouchbaseBucket::get() returns a GetResult interface |
99 | 99 | */ |
100 | - return $this->decodeDocument((array)$this->getCollection()->get($item->getEncodedKey())->content()); |
|
100 | + return $this->decodeDocument((array) $this->getCollection()->get($item->getEncodedKey())->content()); |
|
101 | 101 | } catch (DocumentNotFoundException) { |
102 | 102 | return null; |
103 | 103 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * UNIX ENDPOINT: unix:///tmp/arangodb.sock |
35 | 35 | * Failover ENDPOINTS: ['tcp://127.0.0.1:8529', 'tcp://127.0.0.1:8529'] |
36 | 36 | */ |
37 | - protected string|array $endpoint = 'tcp://127.0.0.1:8529'; |
|
37 | + protected string | array $endpoint = 'tcp://127.0.0.1:8529'; |
|
38 | 38 | |
39 | 39 | protected string $connection = 'Keep-Alive'; // enum{'Close', 'Keep-Alive'} |
40 | 40 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | return $this; |
93 | 93 | } |
94 | 94 | |
95 | - public function getEndpoint(): string|array |
|
95 | + public function getEndpoint(): string | array |
|
96 | 96 | { |
97 | 97 | return $this->endpoint; |
98 | 98 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | /** |
101 | 101 | * @throws PhpfastcacheLogicException |
102 | 102 | */ |
103 | - public function setEndpoint(string|array $endpoint): Config |
|
103 | + public function setEndpoint(string | array $endpoint): Config |
|
104 | 104 | { |
105 | 105 | $this->enforceLockedProperty(__FUNCTION__); |
106 | 106 | $this->endpoint = $endpoint; |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | /** |
157 | 157 | * @return callable|string |
158 | 158 | */ |
159 | - public function getDefaultKeyHashFunction(): callable|string |
|
159 | + public function getDefaultKeyHashFunction(): callable | string |
|
160 | 160 | { |
161 | 161 | return $this->defaultKeyHashFunction; |
162 | 162 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * @throws PhpfastcacheInvalidConfigurationException |
168 | 168 | * @throws PhpfastcacheLogicException |
169 | 169 | */ |
170 | - public function setDefaultKeyHashFunction(callable|string $defaultKeyHashFunction): static |
|
170 | + public function setDefaultKeyHashFunction(callable | string $defaultKeyHashFunction): static |
|
171 | 171 | { |
172 | 172 | $this->enforceLockedProperty(__FUNCTION__); |
173 | 173 | if ($defaultKeyHashFunction && !\is_callable($defaultKeyHashFunction) && (\is_string($defaultKeyHashFunction) && !\function_exists($defaultKeyHashFunction))) { |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | /** |
181 | 181 | * @return callable|string |
182 | 182 | */ |
183 | - public function getDefaultFileNameHashFunction(): callable|string |
|
183 | + public function getDefaultFileNameHashFunction(): callable | string |
|
184 | 184 | { |
185 | 185 | return $this->defaultFileNameHashFunction; |
186 | 186 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | * @throws PhpfastcacheInvalidConfigurationException |
192 | 192 | * @throws PhpfastcacheLogicException |
193 | 193 | */ |
194 | - public function setDefaultFileNameHashFunction(callable|string $defaultFileNameHashFunction): static |
|
194 | + public function setDefaultFileNameHashFunction(callable | string $defaultFileNameHashFunction): static |
|
195 | 195 | { |
196 | 196 | $this->enforceLockedProperty(__FUNCTION__); |
197 | 197 | if (!\is_callable($defaultFileNameHashFunction) && (\is_string($defaultFileNameHashFunction) && !\function_exists($defaultFileNameHashFunction))) { |
@@ -331,8 +331,8 @@ discard block |
||
331 | 331 | */ |
332 | 332 | protected function getDefaultSuperGlobalAccessor(): \Closure |
333 | 333 | { |
334 | - return \Closure::fromCallable(static function (string $superGlobalName, ?string $keyName = null) { |
|
335 | - return match ($superGlobalName) { |
|
334 | + return \Closure::fromCallable(static function(string $superGlobalName, ?string $keyName = null) { |
|
335 | + return match($superGlobalName) { |
|
336 | 336 | 'SERVER' => $keyName !== null ? $_SERVER[$keyName] ?? null : $_SERVER, |
337 | 337 | 'REQUEST' => $keyName !== null ? $_REQUEST[$keyName] ?? null : $_REQUEST, |
338 | 338 | 'COOKIE' => $keyName !== null ? $_COOKIE[$keyName] ?? null : $_COOKIE, |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | { |
99 | 99 | $config = self::validateConfig($config); |
100 | 100 | $driver = self::standardizeDriverName($driver); |
101 | - $instanceId = $instanceId ?: md5($driver . \serialize(\array_filter($config->toArray(), static fn ($val) => !\is_callable($val)))); |
|
101 | + $instanceId = $instanceId ?: md5($driver . \serialize(\array_filter($config->toArray(), static fn($val) => !\is_callable($val)))); |
|
102 | 102 | |
103 | 103 | if (!isset(self::$instances[$instanceId])) { |
104 | 104 | $driverClass = self::validateDriverClass(self::getDriverClass($driver)); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $found = false; |
223 | 223 | self::$instances = \array_filter( |
224 | 224 | \array_map( |
225 | - static function (ExtendedCacheItemPoolInterface $cachePool) use ($cachePoolInstance, &$found) { |
|
225 | + static function(ExtendedCacheItemPoolInterface $cachePool) use ($cachePoolInstance, &$found) { |
|
226 | 226 | if (\spl_object_hash($cachePool) === \spl_object_hash($cachePoolInstance)) { |
227 | 227 | $found = true; |
228 | 228 | return null; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | protected ConfigurationOptionInterface $config; |
42 | 42 | |
43 | - protected object|array|null $instance; |
|
43 | + protected object | array | null $instance; |
|
44 | 44 | |
45 | 45 | protected string $driverName; |
46 | 46 | |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | } |
157 | 157 | |
158 | 158 | if ($stringifyDate) { |
159 | - $wrap = \array_map(static function ($value) { |
|
159 | + $wrap = \array_map(static function($value) { |
|
160 | 160 | if ($value instanceof DateTimeInterface) { |
161 | 161 | return $value->format(DateTimeInterface::W3C); |
162 | 162 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | public function getItem(string $key): ExtendedCacheItemInterface |
61 | 61 | { |
62 | 62 | return $this->getStandardizedItem( |
63 | - $this->makeOperation(static fn (ExtendedCacheItemPoolInterface $pool) => $pool->getItem($key)) ?? new Item($this, $key, $this->getEventManager()), |
|
63 | + $this->makeOperation(static fn(ExtendedCacheItemPoolInterface $pool) => $pool->getItem($key)) ?? new Item($this, $key, $this->getEventManager()), |
|
64 | 64 | $this |
65 | 65 | ); |
66 | 66 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | public function hasItem(string $key): bool |
111 | 111 | { |
112 | 112 | return $this->makeOperation( |
113 | - static fn (ExtendedCacheItemPoolInterface $pool) => $pool->hasItem($key) |
|
113 | + static fn(ExtendedCacheItemPoolInterface $pool) => $pool->hasItem($key) |
|
114 | 114 | ); |
115 | 115 | } |
116 | 116 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | public function clear(): bool |
121 | 121 | { |
122 | 122 | return $this->makeOperation( |
123 | - static fn (ExtendedCacheItemPoolInterface $pool) => $pool->clear() |
|
123 | + static fn(ExtendedCacheItemPoolInterface $pool) => $pool->clear() |
|
124 | 124 | ); |
125 | 125 | } |
126 | 126 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | public function deleteItem(string $key): bool |
131 | 131 | { |
132 | 132 | return $this->makeOperation( |
133 | - static fn (ExtendedCacheItemPoolInterface $pool) => $pool->deleteItem($key) |
|
133 | + static fn(ExtendedCacheItemPoolInterface $pool) => $pool->deleteItem($key) |
|
134 | 134 | ); |
135 | 135 | } |
136 | 136 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | public function save(CacheItemInterface $item): bool |
141 | 141 | { |
142 | 142 | return $this->makeOperation( |
143 | - function (ExtendedCacheItemPoolInterface $pool) use ($item) { |
|
143 | + function(ExtendedCacheItemPoolInterface $pool) use ($item) { |
|
144 | 144 | /** @var ExtendedCacheItemInterface $item */ |
145 | 145 | $item->setHit(true); |
146 | 146 | return $pool->save($this->getStandardizedItem($item, $pool)); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | public function commit(): bool |
156 | 156 | { |
157 | 157 | return $this->makeOperation( |
158 | - static fn (ExtendedCacheItemPoolInterface $pool) => $pool->commit() |
|
158 | + static fn(ExtendedCacheItemPoolInterface $pool) => $pool->commit() |
|
159 | 159 | ); |
160 | 160 | } |
161 | 161 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $this->database->selectCollection($collectionName) |
100 | 100 | ->createIndex( |
101 | 101 | [self::DRIVER_EDATE_WRAPPER_INDEX => 1], |
102 | - ['expireAfterSeconds' => 0, 'name' => 'auto_expire_index'] |
|
102 | + ['expireAfterSeconds' => 0, 'name' => 'auto_expire_index'] |
|
103 | 103 | ); |
104 | 104 | } |
105 | 105 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | self::DRIVER_CDATE_WRAPPER_INDEX => new UTCDateTime($item->getCreationDate()), |
162 | 162 | ]; |
163 | 163 | } |
164 | - $result = (array)$this->getCollection()->updateOne( |
|
164 | + $result = (array) $this->getCollection()->updateOne( |
|
165 | 165 | ['_id' => $this->getMongoDbItemKey($item)], |
166 | 166 | [ |
167 | 167 | '$set' => $set, |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | ) |
231 | 231 | )->toArray()[0]; |
232 | 232 | |
233 | - $arrayFilterRecursive = static function ($array, callable $callback = null) use (&$arrayFilterRecursive) { |
|
233 | + $arrayFilterRecursive = static function($array, callable $callback = null) use (&$arrayFilterRecursive) { |
|
234 | 234 | $array = $callback($array); |
235 | 235 | |
236 | 236 | if (\is_object($array) || \is_array($array)) { |
@@ -242,12 +242,12 @@ discard block |
||
242 | 242 | return $array; |
243 | 243 | }; |
244 | 244 | |
245 | - $callback = static function ($item) { |
|
245 | + $callback = static function($item) { |
|
246 | 246 | /** |
247 | 247 | * Remove unserializable properties |
248 | 248 | */ |
249 | 249 | if ($item instanceof UTCDateTime) { |
250 | - return (string)$item; |
|
250 | + return (string) $item; |
|
251 | 251 | } |
252 | 252 | return $item; |
253 | 253 | }; |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | if (count($servers) > 0) { |
302 | 302 | $host = array_reduce( |
303 | 303 | $servers, |
304 | - static fn ($carry, $data) => $carry . ($carry === '' ? '' : ',') . $data['host'] . ':' . $data['port'], |
|
304 | + static fn($carry, $data) => $carry . ($carry === '' ? '' : ',') . $data['host'] . ':' . $data['port'], |
|
305 | 305 | '' |
306 | 306 | ); |
307 | 307 | $port = false; |