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); }