diff --git a/src/CsrfMiddleware.php b/src/CsrfMiddleware.php index 5dcd2e4..2468af1 100644 --- a/src/CsrfMiddleware.php +++ b/src/CsrfMiddleware.php @@ -25,8 +25,8 @@ class CsrfMiddleware implements MiddlewareInterface public const GUARD_ATTRIBUTE = 'csrf'; public function __construct( - private CsrfGuardFactoryInterface $guardFactory, - private string $attributeKey = self::GUARD_ATTRIBUTE + private readonly CsrfGuardFactoryInterface $guardFactory, + private readonly string $attributeKey = self::GUARD_ATTRIBUTE ) { } diff --git a/src/FlashCsrfGuard.php b/src/FlashCsrfGuard.php index 461eeca..63c0961 100644 --- a/src/FlashCsrfGuard.php +++ b/src/FlashCsrfGuard.php @@ -11,7 +11,7 @@ class FlashCsrfGuard implements CsrfGuardInterface { - public function __construct(private FlashMessagesInterface $flashMessages) + public function __construct(private readonly FlashMessagesInterface $flashMessages) { } diff --git a/src/FlashCsrfGuardFactory.php b/src/FlashCsrfGuardFactory.php index 6183420..1fe0a7d 100644 --- a/src/FlashCsrfGuardFactory.php +++ b/src/FlashCsrfGuardFactory.php @@ -10,7 +10,7 @@ class FlashCsrfGuardFactory implements CsrfGuardFactoryInterface { - public function __construct(private string $attributeKey = FlashMessageMiddleware::FLASH_ATTRIBUTE) + public function __construct(private readonly string $attributeKey = FlashMessageMiddleware::FLASH_ATTRIBUTE) { } diff --git a/src/SessionCsrfGuard.php b/src/SessionCsrfGuard.php index 015f19f..c905020 100644 --- a/src/SessionCsrfGuard.php +++ b/src/SessionCsrfGuard.php @@ -11,7 +11,7 @@ class SessionCsrfGuard implements CsrfGuardInterface { - public function __construct(private SessionInterface $session) + public function __construct(private readonly SessionInterface $session) { } diff --git a/src/SessionCsrfGuardFactory.php b/src/SessionCsrfGuardFactory.php index 6a3dea3..323a77b 100644 --- a/src/SessionCsrfGuardFactory.php +++ b/src/SessionCsrfGuardFactory.php @@ -10,7 +10,7 @@ class SessionCsrfGuardFactory implements CsrfGuardFactoryInterface { - public function __construct(private string $attributeKey = SessionMiddleware::SESSION_ATTRIBUTE) + public function __construct(private readonly string $attributeKey = SessionMiddleware::SESSION_ATTRIBUTE) { }