diff --git a/config/autoload/entity-manager.global.php b/config/autoload/entity-manager.global.php index 08427898..c67809d2 100644 --- a/config/autoload/entity-manager.global.php +++ b/config/autoload/entity-manager.global.php @@ -21,8 +21,8 @@ return (static function (): array { 'mssql' => '1433', default => '3306', }; - $resolveConnection = static fn () => match (true) { - $driver === null || $driver === 'sqlite' => [ + $resolveConnection = static fn () => match ($driver) { + null, 'sqlite' => [ 'driver' => 'pdo_sqlite', 'path' => 'data/database.sqlite', ], diff --git a/config/autoload/redis.global.php b/config/autoload/redis.global.php index 22101b65..fbcb5846 100644 --- a/config/autoload/redis.global.php +++ b/config/autoload/redis.global.php @@ -7,8 +7,8 @@ use function Shlinkio\Shlink\Common\env; return (static function (): array { $redisServers = env('REDIS_SERVERS'); - return match (true) { - $redisServers === null => [], + return match ($redisServers) { + null => [], default => [ 'cache' => [ 'redis' => [ diff --git a/module/Core/src/Visit/RequestTracker.php b/module/Core/src/Visit/RequestTracker.php index 7cefa8a2..dc45e12f 100644 --- a/module/Core/src/Visit/RequestTracker.php +++ b/module/Core/src/Visit/RequestTracker.php @@ -83,10 +83,9 @@ class RequestTracker implements RequestTrackerInterface, RequestMethodInterface $disableTrackingFrom = $this->trackingOptions->disableTrackingFrom(); return some($disableTrackingFrom, function (string $value) use ($ip, $remoteAddrParts): bool { - $range = match (true) { - str_contains($value, '*') => $this->parseValueWithWildcards($value, $remoteAddrParts), - default => Factory::parseRangeString($value), - }; + $range = str_contains($value, '*') + ? $this->parseValueWithWildcards($value, $remoteAddrParts) + : Factory::parseRangeString($value); return $range !== null && $ip->matches($range); }); diff --git a/module/Rest/src/Service/ApiKeyService.php b/module/Rest/src/Service/ApiKeyService.php index d66e70e2..7d7e0710 100644 --- a/module/Rest/src/Service/ApiKeyService.php +++ b/module/Rest/src/Service/ApiKeyService.php @@ -41,7 +41,7 @@ class ApiKeyService implements ApiKeyServiceInterface $expirationDate !== null && $name !== null => ApiKey::fromMeta( ApiKeyMeta::withNameAndExpirationDate($name, $expirationDate), ), - $expirationDate !== null => ApiKey::fromMeta(ApiKeyMeta::withExpirationDate($expirationDate)), + $expirationDate !== null => ApiKey::fromMeta(ApiKeyMeta::withExpirationDate($expirationDate)), $name !== null => ApiKey::fromMeta(ApiKeyMeta::withName($name)), default => ApiKey::create(), };