diff --git a/src/Storageless/Http/ClientFingerprint/Configuration.php b/src/Storageless/Http/ClientFingerprint/Configuration.php index c243dabe..0f6f58a1 100644 --- a/src/Storageless/Http/ClientFingerprint/Configuration.php +++ b/src/Storageless/Http/ClientFingerprint/Configuration.php @@ -4,11 +4,10 @@ namespace PSR7Sessions\Storageless\Http\ClientFingerprint; -/** @immutable */ -final class Configuration +final readonly class Configuration { /** @var list */ - private readonly array $sources; + private array $sources; /** * @param list ...$sources diff --git a/src/Storageless/Http/ClientFingerprint/RemoteAddr.php b/src/Storageless/Http/ClientFingerprint/RemoteAddr.php index fec669dd..6a5ecba6 100644 --- a/src/Storageless/Http/ClientFingerprint/RemoteAddr.php +++ b/src/Storageless/Http/ClientFingerprint/RemoteAddr.php @@ -9,8 +9,7 @@ use function array_key_exists; use function is_string; -/** @immutable */ -final class RemoteAddr implements Source +final readonly class RemoteAddr implements Source { private const SERVER_PARAM_NAME = 'REMOTE_ADDR'; diff --git a/src/Storageless/Http/ClientFingerprint/SameOriginRequest.php b/src/Storageless/Http/ClientFingerprint/SameOriginRequest.php index b371d6ba..cdb039a2 100644 --- a/src/Storageless/Http/ClientFingerprint/SameOriginRequest.php +++ b/src/Storageless/Http/ClientFingerprint/SameOriginRequest.php @@ -19,22 +19,18 @@ use const JSON_THROW_ON_ERROR; -/** - * @internal - * - * @immutable - */ -final class SameOriginRequest implements Constraint +/** @internal */ +final readonly class SameOriginRequest implements Constraint { public const CLAIM = 'fp'; /** @var list */ - private readonly array $sources; + private array $sources; /** @var non-empty-string */ - private readonly string $currentRequestFingerprint; + private string $currentRequestFingerprint; public function __construct( - private readonly Configuration $configuration, + private Configuration $configuration, ServerRequestInterface $serverRequest, ) { $this->sources = $this->configuration->sources(); diff --git a/src/Storageless/Http/ClientFingerprint/UserAgent.php b/src/Storageless/Http/ClientFingerprint/UserAgent.php index 5463b62e..ea379d01 100644 --- a/src/Storageless/Http/ClientFingerprint/UserAgent.php +++ b/src/Storageless/Http/ClientFingerprint/UserAgent.php @@ -6,8 +6,7 @@ use Psr\Http\Message\ServerRequestInterface; -/** @immutable */ -final class UserAgent implements Source +final readonly class UserAgent implements Source { public function extractFrom(ServerRequestInterface $request): string { diff --git a/src/Storageless/Http/SessionMiddleware.php b/src/Storageless/Http/SessionMiddleware.php index e7240984..2c3f6870 100644 --- a/src/Storageless/Http/SessionMiddleware.php +++ b/src/Storageless/Http/SessionMiddleware.php @@ -43,14 +43,13 @@ use function sprintf; -/** @immutable */ -final class SessionMiddleware implements MiddlewareInterface +final readonly class SessionMiddleware implements MiddlewareInterface { public const SESSION_CLAIM = 'session-data'; public const SESSION_ATTRIBUTE = 'session'; public function __construct( - private readonly Configuration $config, + private Configuration $config, ) { }