@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | /** |
147 | 147 | * @return callable|string |
148 | 148 | */ |
149 | - public function getDefaultKeyHashFunction(): callable|string |
|
149 | + public function getDefaultKeyHashFunction(): callable | string |
|
150 | 150 | { |
151 | 151 | return $this->defaultKeyHashFunction; |
152 | 152 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | * @return ConfigurationOption |
157 | 157 | * @throws PhpfastcacheInvalidConfigurationException |
158 | 158 | */ |
159 | - public function setDefaultKeyHashFunction(callable|string $defaultKeyHashFunction): static |
|
159 | + public function setDefaultKeyHashFunction(callable | string $defaultKeyHashFunction): static |
|
160 | 160 | { |
161 | 161 | if ($defaultKeyHashFunction && !\is_callable($defaultKeyHashFunction) && (\is_string($defaultKeyHashFunction) && !\function_exists($defaultKeyHashFunction))) { |
162 | 162 | throw new PhpfastcacheInvalidConfigurationException('defaultKeyHashFunction must be a valid function name string'); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | /** |
169 | 169 | * @return callable|string |
170 | 170 | */ |
171 | - public function getDefaultFileNameHashFunction(): callable|string |
|
171 | + public function getDefaultFileNameHashFunction(): callable | string |
|
172 | 172 | { |
173 | 173 | return $this->defaultFileNameHashFunction; |
174 | 174 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * @return ConfigurationOption |
179 | 179 | * @throws PhpfastcacheInvalidConfigurationException |
180 | 180 | */ |
181 | - public function setDefaultFileNameHashFunction(callable|string $defaultFileNameHashFunction): static |
|
181 | + public function setDefaultFileNameHashFunction(callable | string $defaultFileNameHashFunction): static |
|
182 | 182 | { |
183 | 183 | if (!\is_callable($defaultFileNameHashFunction) && (\is_string($defaultFileNameHashFunction) && !\function_exists($defaultFileNameHashFunction))) { |
184 | 184 | throw new PhpfastcacheInvalidConfigurationException('defaultFileNameHashFunction must be a valid function name string'); |
@@ -307,8 +307,8 @@ discard block |
||
307 | 307 | */ |
308 | 308 | protected function getDefaultSuperGlobalAccessor(): \Closure |
309 | 309 | { |
310 | - return \Closure::fromCallable(static function (string $superGlobalName, ?string $keyName = null) { |
|
311 | - return match ($superGlobalName) { |
|
310 | + return \Closure::fromCallable(static function(string $superGlobalName, ?string $keyName = null) { |
|
311 | + return match($superGlobalName) { |
|
312 | 312 | 'SERVER' => $keyName !== null ? $_SERVER[$keyName] ?? null : $_SERVER, |
313 | 313 | 'REQUEST' => $keyName !== null ? $_REQUEST[$keyName] ?? null : $_REQUEST, |
314 | 314 | 'COOKIE' => $keyName !== null ? $_COOKIE[$keyName] ?? null : $_COOKIE, |
@@ -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()) { |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $config = self::validateConfig($config); |
141 | 141 | $driver = self::standardizeDriverName($driver); |
142 | 142 | |
143 | - $instanceId = $instanceId ?: md5($driver . \serialize(\array_filter($config->toArray(), static fn ($val) => !\is_callable($val)))); |
|
143 | + $instanceId = $instanceId ?: md5($driver . \serialize(\array_filter($config->toArray(), static fn($val) => !\is_callable($val)))); |
|
144 | 144 | |
145 | 145 | if (!isset(self::$instances[$instanceId])) { |
146 | 146 | $driverClass = self::validateDriverClass(self::getDriverClass($driver)); |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | $found = false; |
260 | 260 | self::$instances = \array_filter( |
261 | 261 | \array_map( |
262 | - static function (ExtendedCacheItemPoolInterface $cachePool) use ($cachePoolInstance, &$found) { |
|
262 | + static function(ExtendedCacheItemPoolInterface $cachePool) use ($cachePoolInstance, &$found) { |
|
263 | 263 | if (\spl_object_hash($cachePool) === \spl_object_hash($cachePoolInstance)) { |
264 | 264 | $found = true; |
265 | 265 | return null; |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | */ |
279 | 279 | public static function setDefaultConfig(ConfigurationOption $config): void |
280 | 280 | { |
281 | - if(is_subclass_of($config, ConfigurationOption::class)){ |
|
281 | + if (is_subclass_of($config, ConfigurationOption::class)) { |
|
282 | 282 | throw new PhpfastcacheInvalidArgumentException('Default configuration cannot be a child class of ConfigurationOption::class'); |
283 | 283 | } |
284 | 284 | self::$config = $config; |