diff --git a/src/AuthenticationResult.php b/src/AuthenticationResult.php index cdcd7ed..d33520d 100644 --- a/src/AuthenticationResult.php +++ b/src/AuthenticationResult.php @@ -8,17 +8,17 @@ class AuthenticationResult { - protected const FAILURE = 0; - protected const SUCCESS = 1; - protected const FAILURE_INVALID_CREDENTIALS = -1; - protected const FAILURE_IDENTITY_AMBIGUOUS = -2; - protected const FAILURE_IDENTITY_NOT_FOUND = -3; - protected const FAILURE_UNCATEGORIZED = -4; - protected const FAILURE_MISSING_CREDENTIALS = -5; + public const FAILURE = 0; + public const SUCCESS = 1; + public const FAILURE_INVALID_CREDENTIALS = -1; + public const FAILURE_IDENTITY_AMBIGUOUS = -2; + public const FAILURE_IDENTITY_NOT_FOUND = -3; + public const FAILURE_UNCATEGORIZED = -4; + public const FAILURE_MISSING_CREDENTIALS = -5; protected int $code; - protected IdentityInterface $identity; + protected ?IdentityInterface $identity = null; protected string $message = ''; diff --git a/test/AuthenticationResultTest.php b/test/AuthenticationResultTest.php index 01574fa..0f84c13 100644 --- a/test/AuthenticationResultTest.php +++ b/test/AuthenticationResultTest.php @@ -13,17 +13,17 @@ class AuthenticationResultTest extends TestCase { protected AuthenticationResult $subject; - protected IdentityInterface|MockObject $indentyInterfaceMock; + protected IdentityInterface|MockObject $identityInterfaceMock; /** * @throws Exception */ protected function setUp(): void { - $this->indentyInterfaceMock = $this->createMock(IdentityInterface::class); - $this->indentyInterfaceMock->method('getId')->will($this->returnValue(10)); - $this->indentyInterfaceMock->method('getName')->willReturn('username'); - $this->subject = new AuthenticationResult(2, 'valid', $this->indentyInterfaceMock); + $this->identityInterfaceMock = $this->createMock(IdentityInterface::class); + $this->identityInterfaceMock->method('getId')->will($this->returnValue(10)); + $this->identityInterfaceMock->method('getName')->willReturn('username'); + $this->subject = new AuthenticationResult(2, 'valid', $this->identityInterfaceMock); } public function testAuth()