diff --git a/src/Contracts/ContextSerializer.php b/src/Contracts/ContextSerializer.php index f0c8e2d..bb632c8 100644 --- a/src/Contracts/ContextSerializer.php +++ b/src/Contracts/ContextSerializer.php @@ -8,5 +8,5 @@ interface ContextSerializer { - public function serialize(?Context $context = null): string; + public function serialize(Context $context = null): string; } diff --git a/src/Contracts/KeyGenerator.php b/src/Contracts/KeyGenerator.php index cbd2742..8a10994 100644 --- a/src/Contracts/KeyGenerator.php +++ b/src/Contracts/KeyGenerator.php @@ -8,7 +8,7 @@ interface KeyGenerator { - public function generate(string $key, ?Context $context = null): string; + public function generate(string $key, Context $context = null): string; public function removeContextFromKey(string $key): string; diff --git a/src/Drivers/Factory.php b/src/Drivers/Factory.php index 5b7194c..36e9d4a 100644 --- a/src/Drivers/Factory.php +++ b/src/Drivers/Factory.php @@ -21,7 +21,7 @@ public function __construct(protected Application $app) { } - public function driver(?string $driver = null): Driver + public function driver(string $driver = null): Driver { return $this->resolveDriver($driver); } @@ -64,7 +64,7 @@ protected function getDriverConfig(string $driver): ?array return $this->app['config']["settings.drivers.{$driver}"]; } - protected function resolveDriver(?string $driver = null): Driver + protected function resolveDriver(string $driver = null): Driver { $driver = $driver ?: $this->getDefaultDriver(); diff --git a/src/Settings.php b/src/Settings.php index 8f5a6f4..337349b 100755 --- a/src/Settings.php +++ b/src/Settings.php @@ -79,7 +79,7 @@ public function getDriver(): Driver * Pass in `false` for context when calling `all()` to only return results * that do not have context. */ - public function context(Context|bool|null $context = null): self + public function context(Context|bool $context = null): self { $this->context = $context; diff --git a/src/Support/ContextSerializers/ContextSerializer.php b/src/Support/ContextSerializers/ContextSerializer.php index 601b3c7..fd8f0cd 100644 --- a/src/Support/ContextSerializers/ContextSerializer.php +++ b/src/Support/ContextSerializers/ContextSerializer.php @@ -9,7 +9,7 @@ class ContextSerializer implements ContextSerializerContract { - public function serialize(?Context $context = null): string + public function serialize(Context $context = null): string { return serialize($context); } diff --git a/src/Support/ContextSerializers/DotNotationContextSerializer.php b/src/Support/ContextSerializers/DotNotationContextSerializer.php index d271d98..5f36336 100644 --- a/src/Support/ContextSerializers/DotNotationContextSerializer.php +++ b/src/Support/ContextSerializers/DotNotationContextSerializer.php @@ -9,7 +9,7 @@ class DotNotationContextSerializer implements ContextSerializerContract { - public function serialize(?Context $context = null): string + public function serialize(Context $context = null): string { if (is_null($context)) { return ''; diff --git a/src/Support/KeyGenerators/Md5KeyGenerator.php b/src/Support/KeyGenerators/Md5KeyGenerator.php index da417b3..d827090 100644 --- a/src/Support/KeyGenerators/Md5KeyGenerator.php +++ b/src/Support/KeyGenerators/Md5KeyGenerator.php @@ -13,7 +13,7 @@ class Md5KeyGenerator implements KeyGeneratorContract { protected ContextSerializer $serializer; - public function generate(string $key, ?Context $context = null): string + public function generate(string $key, Context $context = null): string { return md5($key . $this->serializer->serialize($context)); } diff --git a/src/Support/KeyGenerators/ReadableKeyGenerator.php b/src/Support/KeyGenerators/ReadableKeyGenerator.php index de4ae74..9c73f73 100644 --- a/src/Support/KeyGenerators/ReadableKeyGenerator.php +++ b/src/Support/KeyGenerators/ReadableKeyGenerator.php @@ -13,7 +13,7 @@ class ReadableKeyGenerator implements KeyGeneratorContract { protected ContextSerializer $serializer; - public function generate(string $key, ?Context $context = null): string + public function generate(string $key, Context $context = null): string { $key = $this->normalizeKey($key);