@@ -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, |
@@ -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 | } |
@@ -35,11 +35,11 @@ |
||
35 | 35 | * @return mixed |
36 | 36 | * @throws InvalidArgumentException |
37 | 37 | */ |
38 | - public function get(string $cacheKey, callable $callback, DateInterval|int $expiresAfter = null): mixed |
|
38 | + public function get(string $cacheKey, callable $callback, DateInterval | int $expiresAfter = null): mixed |
|
39 | 39 | { |
40 | 40 | $cacheItem = $this->cacheInstance->getItem($cacheKey); |
41 | 41 | |
42 | - if (! $cacheItem->isHit()) { |
|
42 | + if (!$cacheItem->isHit()) { |
|
43 | 43 | /* |
44 | 44 | * Parameter $cacheItem will be available as of 8.0.6 |
45 | 45 | */ |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * @return bool |
88 | 88 | * @throws PhpfastcacheSimpleCacheException |
89 | 89 | */ |
90 | - public function set(string $key, mixed $value, null|int|\DateInterval $ttl = null): bool |
|
90 | + public function set(string $key, mixed $value, null | int | \DateInterval $ttl = null): bool |
|
91 | 91 | { |
92 | 92 | try { |
93 | 93 | $cacheItem = $this->internalCacheInstance |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | } |
146 | 146 | try { |
147 | 147 | return \array_map( |
148 | - static fn (ExtendedCacheItemInterface $item) => $item->isHit() ? $item->get() : $default, |
|
148 | + static fn(ExtendedCacheItemInterface $item) => $item->isHit() ? $item->get() : $default, |
|
149 | 149 | $this->internalCacheInstance->getItems($keys) |
150 | 150 | ); |
151 | 151 | } catch (PhpfastcacheInvalidArgumentException $e) { |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * @return bool |
160 | 160 | * @throws PhpfastcacheSimpleCacheException |
161 | 161 | */ |
162 | - public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null): bool |
|
162 | + public function setMultiple(iterable $values, null | int | \DateInterval $ttl = null): bool |
|
163 | 163 | { |
164 | 164 | try { |
165 | 165 | foreach ($values as $key => $value) { |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @return ExtendedCacheItemInterface |
172 | 172 | * @throws PhpfastcacheInvalidTypeException |
173 | 173 | */ |
174 | - public function append(array|string $data): ExtendedCacheItemInterface; |
|
174 | + public function append(array | string $data): ExtendedCacheItemInterface; |
|
175 | 175 | |
176 | 176 | /** |
177 | 177 | * @param array|string $data |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | * @return ExtendedCacheItemInterface |
180 | 180 | * @throws PhpfastcacheInvalidTypeException |
181 | 181 | */ |
182 | - public function prepend(array|string $data): ExtendedCacheItemInterface; |
|
182 | + public function prepend(array | string $data): ExtendedCacheItemInterface; |
|
183 | 183 | |
184 | 184 | /** |
185 | 185 | * Return the data as a well-formatted string. |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | /** |
246 | 246 | * @throws PhpfastcacheInvalidTypeException |
247 | 247 | */ |
248 | - public function append(array|string $data): ExtendedCacheItemInterface |
|
248 | + public function append(array | string $data): ExtendedCacheItemInterface |
|
249 | 249 | { |
250 | 250 | if ($this->data !== null && !\is_string($this->data) && !\is_array($this->data)) { |
251 | 251 | throw new PhpfastcacheInvalidTypeException(\sprintf('Cannot append on a "%s" type.', \gettype($this->data))); |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | /** |
264 | 264 | * @throws PhpfastcacheInvalidTypeException |
265 | 265 | */ |
266 | - public function prepend(array|string $data): ExtendedCacheItemInterface |
|
266 | + public function prepend(array | string $data): ExtendedCacheItemInterface |
|
267 | 267 | { |
268 | 268 | if ($this->data !== null && !\is_string($this->data) && !\is_array($this->data)) { |
269 | 269 | throw new PhpfastcacheInvalidTypeException(\sprintf('Cannot prepend on a "%s" type.', \gettype($this->data))); |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | implode( |
202 | 202 | ', ', |
203 | 203 | array_map( |
204 | - static fn (ExtendedCacheItemPoolInterface $pool) => \get_class($pool), |
|
204 | + static fn(ExtendedCacheItemPoolInterface $pool) => \get_class($pool), |
|
205 | 205 | $this->clusterPools |
206 | 206 | ) |
207 | 207 | ) |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $stats->setSize( |
212 | 212 | (int) array_sum( |
213 | 213 | array_map( |
214 | - static fn (ExtendedCacheItemPoolInterface $pool) => $pool->getStats()->getSize(), |
|
214 | + static fn(ExtendedCacheItemPoolInterface $pool) => $pool->getStats()->getSize(), |
|
215 | 215 | $this->clusterPools |
216 | 216 | ) |
217 | 217 | ) |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | implode( |
222 | 222 | ', ', |
223 | 223 | array_map( |
224 | - static fn (ExtendedCacheItemPoolInterface $pool) => $pool->getStats()->getData(), |
|
224 | + static fn(ExtendedCacheItemPoolInterface $pool) => $pool->getStats()->getData(), |
|
225 | 225 | $this->clusterPools |
226 | 226 | ) |
227 | 227 | ) |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | public function getItem(string $key): ExtendedCacheItemInterface |
55 | 55 | { |
56 | 56 | return $this->getStandardizedItem( |
57 | - $this->makeOperation(static fn (ExtendedCacheItemPoolInterface $pool) => $pool->getItem($key)) ?? new Item($this, $key, $this->getEventManager()), |
|
57 | + $this->makeOperation(static fn(ExtendedCacheItemPoolInterface $pool) => $pool->getItem($key)) ?? new Item($this, $key, $this->getEventManager()), |
|
58 | 58 | $this |
59 | 59 | ); |
60 | 60 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | public function hasItem(string $key): bool |
100 | 100 | { |
101 | 101 | return $this->makeOperation( |
102 | - static fn (ExtendedCacheItemPoolInterface $pool) => $pool->hasItem($key) |
|
102 | + static fn(ExtendedCacheItemPoolInterface $pool) => $pool->hasItem($key) |
|
103 | 103 | ); |
104 | 104 | } |
105 | 105 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | public function clear(): bool |
110 | 110 | { |
111 | 111 | return $this->makeOperation( |
112 | - static fn (ExtendedCacheItemPoolInterface $pool) => $pool->clear() |
|
112 | + static fn(ExtendedCacheItemPoolInterface $pool) => $pool->clear() |
|
113 | 113 | ); |
114 | 114 | } |
115 | 115 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | public function deleteItem(string $key): bool |
120 | 120 | { |
121 | 121 | return $this->makeOperation( |
122 | - static fn (ExtendedCacheItemPoolInterface $pool) => $pool->deleteItem($key) |
|
122 | + static fn(ExtendedCacheItemPoolInterface $pool) => $pool->deleteItem($key) |
|
123 | 123 | ); |
124 | 124 | } |
125 | 125 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | public function save(CacheItemInterface $item): bool |
130 | 130 | { |
131 | 131 | return $this->makeOperation( |
132 | - function (ExtendedCacheItemPoolInterface $pool) use ($item) { |
|
132 | + function(ExtendedCacheItemPoolInterface $pool) use ($item) { |
|
133 | 133 | /* @var ExtendedCacheItemInterface $item */ |
134 | 134 | $item->setHit(true); |
135 | 135 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | public function commit(): bool |
145 | 145 | { |
146 | 146 | return $this->makeOperation( |
147 | - static fn (ExtendedCacheItemPoolInterface $pool) => $pool->commit() |
|
147 | + static fn(ExtendedCacheItemPoolInterface $pool) => $pool->commit() |
|
148 | 148 | ); |
149 | 149 | } |
150 | 150 | } |