@@ -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))) { |
@@ -332,8 +332,8 @@ discard block |
||
| 332 | 332 | */ |
| 333 | 333 | protected function getDefaultSuperGlobalAccessor(): \Closure |
| 334 | 334 | { |
| 335 | - return \Closure::fromCallable(static function (string $superGlobalName, ?string $keyName = null): string|int|float|array|bool|null { |
|
| 336 | - return match ($superGlobalName) { |
|
| 335 | + return \Closure::fromCallable(static function(string $superGlobalName, ?string $keyName = null): string | int | float | array | bool | null { |
|
| 336 | + return match($superGlobalName) { |
|
| 337 | 337 | 'SERVER' => $keyName !== null ? $_SERVER[$keyName] ?? null : $_SERVER, |
| 338 | 338 | 'REQUEST' => $keyName !== null ? $_REQUEST[$keyName] ?? null : $_REQUEST, |
| 339 | 339 | 'COOKIE' => $keyName !== null ? $_COOKIE[$keyName] ?? null : $_COOKIE, |
@@ -140,7 +140,7 @@ |
||
| 140 | 140 | /** |
| 141 | 141 | * Allows dereferencing char |
| 142 | 142 | */ |
| 143 | - $file = preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__);// remove file protocols such as "phar://" etc. |
|
| 143 | + $file = preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__); // remove file protocols such as "phar://" etc. |
|
| 144 | 144 | $prefix = $file[0] === DIRECTORY_SEPARATOR ? DIRECTORY_SEPARATOR : ''; |
| 145 | 145 | return $prefix . implode(DIRECTORY_SEPARATOR, $absolutes); |
| 146 | 146 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | /** |
| 32 | 32 | * @throws InvalidArgumentException |
| 33 | 33 | */ |
| 34 | - public function get(string $cacheKey, callable $callback, DateInterval|int $expiresAfter = null): mixed |
|
| 34 | + public function get(string $cacheKey, callable $callback, DateInterval | int $expiresAfter = null): mixed |
|
| 35 | 35 | { |
| 36 | 36 | $cacheItem = $this->cacheInstance->getItem($cacheKey); |
| 37 | 37 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | /** |
| 54 | 54 | * @throws InvalidArgumentException |
| 55 | 55 | */ |
| 56 | - public function __invoke(string $cacheKey, callable $callback, DateInterval|int $expiresAfter = null): mixed |
|
| 56 | + public function __invoke(string $cacheKey, callable $callback, DateInterval | int $expiresAfter = null): mixed |
|
| 57 | 57 | { |
| 58 | 58 | return $this->get($cacheKey, $callback, $expiresAfter); |
| 59 | 59 | } |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | throw new PhpfastcacheInvalidConfigurationException('Path must be a valid string in "$server" configuration array if host is not defined'); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - if (!empty($server['host']) && (empty($server['port']) || !is_int($server['port'])|| $server['port'] < 1)) { |
|
| 93 | + if (!empty($server['host']) && (empty($server['port']) || !is_int($server['port']) || $server['port'] < 1)) { |
|
| 94 | 94 | throw new PhpfastcacheInvalidConfigurationException('Port must be a valid integer in "$server" configuration array'); |
| 95 | 95 | } |
| 96 | 96 | |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | throw new PhpfastcacheInvalidConfigurationException('Path must be a valid string in "$server" configuration array if host is not defined'); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - if (!empty($server['host']) && (empty($server['port']) || !is_int($server['port'])|| $server['port'] < 1)) { |
|
| 93 | + if (!empty($server['host']) && (empty($server['port']) || !is_int($server['port']) || $server['port'] < 1)) { |
|
| 94 | 94 | throw new PhpfastcacheInvalidConfigurationException('Port must be a valid integer in "$server" configuration array'); |
| 95 | 95 | } |
| 96 | 96 | |