@@ -307,7 +307,7 @@ |
||
| 307 | 307 | ->setSize($count); |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | - public function getConfig() : Config|ConfigurationOption |
|
| 310 | + public function getConfig() : Config | ConfigurationOption |
|
| 311 | 311 | { |
| 312 | 312 | return $this->config; |
| 313 | 313 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | * UNIX ENDPOINT: unix:///tmp/arangodb.sock |
| 34 | 34 | * Failover ENDPOINTS: ['tcp://localhost:8529', 'tcp://another-host:8529'] |
| 35 | 35 | */ |
| 36 | - protected string|array $endpoint = 'tcp://127.0.0.1:8529'; |
|
| 36 | + protected string | array $endpoint = 'tcp://127.0.0.1:8529'; |
|
| 37 | 37 | |
| 38 | 38 | protected string $connection = 'Keep-Alive'; // enum{'Close', 'Keep-Alive'} |
| 39 | 39 | |
@@ -83,12 +83,12 @@ discard block |
||
| 83 | 83 | return $this; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - public function getEndpoint(): string|array |
|
| 86 | + public function getEndpoint(): string | array |
|
| 87 | 87 | { |
| 88 | 88 | return $this->endpoint; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - public function setEndpoint(string|array $endpoint): Config |
|
| 91 | + public function setEndpoint(string | array $endpoint): Config |
|
| 92 | 92 | { |
| 93 | 93 | $this->endpoint = $endpoint; |
| 94 | 94 | return $this; |
@@ -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; |