diff --git a/src/FlashMessageMiddleware.php b/src/FlashMessageMiddleware.php index 946aff3..724974c 100644 --- a/src/FlashMessageMiddleware.php +++ b/src/FlashMessageMiddleware.php @@ -17,14 +17,12 @@ class FlashMessageMiddleware implements MiddlewareInterface { public const FLASH_ATTRIBUTE = 'flash'; - /** @var string */ - private $attributeKey; + private string $attributeKey; /** @psalm-var callable(SessionInterface, string): FlashMessagesInterface */ private $flashMessageFactory; - /** @var string */ - private $sessionKey; + private string $sessionKey; public function __construct( string $flashMessagesClass = FlashMessages::class, diff --git a/src/FlashMessages.php b/src/FlashMessages.php index dabd263..373c182 100644 --- a/src/FlashMessages.php +++ b/src/FlashMessages.php @@ -30,13 +30,11 @@ class FlashMessages implements FlashMessagesInterface { /** @var array */ - private $currentMessages = []; + private array $currentMessages = []; - /** @var SessionInterface */ - private $session; + private SessionInterface $session; - /** @var string */ - private $sessionKey; + private string $sessionKey; private function __construct(SessionInterface $session, string $sessionKey) { diff --git a/test/ConfigProviderTest.php b/test/ConfigProviderTest.php index 159bd1b..2d3bc30 100644 --- a/test/ConfigProviderTest.php +++ b/test/ConfigProviderTest.php @@ -9,8 +9,7 @@ class ConfigProviderTest extends TestCase { - /** @var ConfigProvider */ - private $provider; + private ConfigProvider $provider; public function setUp(): void { diff --git a/test/FlashMessageMiddlewareTest.php b/test/FlashMessageMiddlewareTest.php index 9481692..94e84ce 100644 --- a/test/FlashMessageMiddlewareTest.php +++ b/test/FlashMessageMiddlewareTest.php @@ -78,7 +78,7 @@ public function testProcessUsesConfiguredClassAndSessionKeyAndAttributeKeyToCrea ->method('withAttribute') ->with( 'non-standard-flash-attr', - $this->callback(function (TestAsset\FlashMessages $flash) use ($session) { + $this->callback(function (TestAsset\FlashMessages $flash) use ($session): bool { $this->assertSame($session, $flash->session); $this->assertSame('non-standard-flash-next', $flash->sessionKey); return true;