From cd9922fed9878927019b295f40203f5cb0fa0f12 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sun, 3 Nov 2024 13:46:00 +0700 Subject: [PATCH] Update to use PHP 8.1 syntax Signed-off-by: Abdul Malik Ikhsan --- src/FlashMessageMiddleware.php | 4 ++-- src/FlashMessages.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/FlashMessageMiddleware.php b/src/FlashMessageMiddleware.php index 6a0702a..c7cdbde 100644 --- a/src/FlashMessageMiddleware.php +++ b/src/FlashMessageMiddleware.php @@ -22,8 +22,8 @@ class FlashMessageMiddleware implements MiddlewareInterface public function __construct( string $flashMessagesClass = FlashMessages::class, - private string $sessionKey = FlashMessagesInterface::FLASH_NEXT, - private string $attributeKey = self::FLASH_ATTRIBUTE + private readonly string $sessionKey = FlashMessagesInterface::FLASH_NEXT, + private readonly string $attributeKey = self::FLASH_ATTRIBUTE ) { $factory = [$flashMessagesClass, 'createFromSession']; if (! is_callable($factory)) { diff --git a/src/FlashMessages.php b/src/FlashMessages.php index 4ab3c62..801ab3f 100644 --- a/src/FlashMessages.php +++ b/src/FlashMessages.php @@ -32,7 +32,7 @@ class FlashMessages implements FlashMessagesInterface /** @var array */ private array $currentMessages = []; - private function __construct(private SessionInterface $session, private string $sessionKey) + private function __construct(private readonly SessionInterface $session, private readonly string $sessionKey) { $this->prepareMessages($session, $sessionKey); }