From a8f9184559bb5ecb22cb664134898c2a181f92ed Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Sun, 1 Dec 2024 19:56:57 +1300 Subject: [PATCH] API Explicity mark nullable parameters for PHP 8.4 --- src/CredentialRepositoryProviderTrait.php | 2 +- src/VerifyHandler.php | 2 +- tests/RegisterHandlerTest.php | 4 ++-- tests/VerifyHandlerTest.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/CredentialRepositoryProviderTrait.php b/src/CredentialRepositoryProviderTrait.php index b9d4d4b..2e0dd05 100644 --- a/src/CredentialRepositoryProviderTrait.php +++ b/src/CredentialRepositoryProviderTrait.php @@ -19,7 +19,7 @@ trait CredentialRepositoryProviderTrait */ protected function getCredentialRepository( StoreInterface $store, - RegisteredMethod $registeredMethod = null + ?RegisteredMethod $registeredMethod = null ): CredentialRepository { $state = $store->getState(); diff --git a/src/VerifyHandler.php b/src/VerifyHandler.php index 74054a3..a089f3f 100644 --- a/src/VerifyHandler.php +++ b/src/VerifyHandler.php @@ -165,7 +165,7 @@ public function getComponent(): string */ protected function getCredentialRequestOptions( StoreInterface $store, - RegisteredMethod $registeredMethod = null, + ?RegisteredMethod $registeredMethod = null, $reset = false ): PublicKeyCredentialRequestOptions { $state = $store->getState(); diff --git a/tests/RegisterHandlerTest.php b/tests/RegisterHandlerTest.php index 950096a..2463b27 100644 --- a/tests/RegisterHandlerTest.php +++ b/tests/RegisterHandlerTest.php @@ -175,8 +175,8 @@ public function testRegister( $mockResponse, $expectedResult, $expectedCredentialCount, - callable $responseValidatorMockCallback = null, - callable $storeModifier = null + ?callable $responseValidatorMockCallback = null, + ?callable $storeModifier = null ) { /** @var RegisterHandler&MockObject $handlerMock */ $handlerMock = $this->getMockBuilder(RegisterHandler::class) diff --git a/tests/VerifyHandlerTest.php b/tests/VerifyHandlerTest.php index b65387a..69b9ae0 100644 --- a/tests/VerifyHandlerTest.php +++ b/tests/VerifyHandlerTest.php @@ -129,7 +129,7 @@ public function testVerifyReturnsErrorWhenRequiredInformationIsMissing() public function testVerify( $mockResponse, $expectedResult, - callable $responseValidatorMockCallback = null + ?callable $responseValidatorMockCallback = null ) { /** @var VerifyHandler&MockObject $handlerMock */ $handlerMock = $this->getMockBuilder(VerifyHandler::class)