From 3e41a987ba864af618713709b6754a0e8d7b37d4 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sun, 3 Nov 2024 09:34:59 +0700 Subject: [PATCH] Update to latest PHP 8.1 syntax Signed-off-by: Abdul Malik Ikhsan --- src/CsrfMiddleware.php | 4 ++-- src/FlashCsrfGuard.php | 2 +- src/FlashCsrfGuardFactory.php | 2 +- src/SessionCsrfGuard.php | 2 +- src/SessionCsrfGuardFactory.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) 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) { }