From ca2894fb225d8729392f3c6fb3bc658b2d14ccfb Mon Sep 17 00:00:00 2001 From: poprazvan17 Date: Thu, 20 Jul 2023 13:32:53 +0300 Subject: [PATCH 1/5] added static analysis badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 07540d1..0148db8 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ Authentication base package defining interfaces for authentication services to b [![GitHub stars](https://img.shields.io/github/stars/dotkernel/dot-authentication)](https://github.com/dotkernel/dot-authentication/stargazers) [![GitHub license](https://img.shields.io/github/license/dotkernel/dot-authentication)](https://github.com/dotkernel/dot-authentication/blob/2.1/LICENSE.md) +[![Build Static](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml/badge.svg?branch=3.0)](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml) + [![SymfonyInsight](https://insight.symfony.com/projects/8a0dfa12-fdda-43d7-bdbe-1c6996b30c12/big.svg)](https://insight.symfony.com/projects/8a0dfa12-fdda-43d7-bdbe-1c6996b30c12) ## Installation From 085e9457e2b5ce10039f14ec3e604e39b0c50443 Mon Sep 17 00:00:00 2001 From: poprazvan17 Date: Thu, 20 Jul 2023 13:34:08 +0300 Subject: [PATCH 2/5] added static analysis badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0148db8..a60c501 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Authentication base package defining interfaces for authentication services to b [![GitHub stars](https://img.shields.io/github/stars/dotkernel/dot-authentication)](https://github.com/dotkernel/dot-authentication/stargazers) [![GitHub license](https://img.shields.io/github/license/dotkernel/dot-authentication)](https://github.com/dotkernel/dot-authentication/blob/2.1/LICENSE.md) -[![Build Static](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml/badge.svg?branch=3.0)](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml) +[![Build Static](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml/badge.svg?branch=2.0)](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml) [![SymfonyInsight](https://insight.symfony.com/projects/8a0dfa12-fdda-43d7-bdbe-1c6996b30c12/big.svg)](https://insight.symfony.com/projects/8a0dfa12-fdda-43d7-bdbe-1c6996b30c12) From e7726b36319bd685923374f04cc22678ee32e655 Mon Sep 17 00:00:00 2001 From: poprazvan17 Date: Mon, 14 Aug 2023 19:30:46 +0300 Subject: [PATCH 3/5] issue 18- Type hint and access modifiers --- src/AuthenticationResult.php | 16 ++++++++-------- test/AuthenticationResultTest.php | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/AuthenticationResult.php b/src/AuthenticationResult.php index cdcd7ed..3043350 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; 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() From ecdfe1fd3c1e12423a8d8606cd57e00ac1a95a99 Mon Sep 17 00:00:00 2001 From: poprazvan17 Date: Thu, 17 Aug 2023 12:37:42 +0300 Subject: [PATCH 4/5] issue 18- Type hint and access modifiers --- src/AuthenticationResult.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AuthenticationResult.php b/src/AuthenticationResult.php index 3043350..d33520d 100644 --- a/src/AuthenticationResult.php +++ b/src/AuthenticationResult.php @@ -18,7 +18,7 @@ class AuthenticationResult protected int $code; - protected ?IdentityInterface $identity; + protected ?IdentityInterface $identity = null; protected string $message = ''; From 93b1c285a43ed7bee7bcae9d63bbd0bee567fe89 Mon Sep 17 00:00:00 2001 From: poprazvan17 Date: Thu, 17 Aug 2023 20:54:38 +0300 Subject: [PATCH 5/5] issue 18- Type hint and access modifiers --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index b3b12c5..ece526b 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,6 @@ Authentication base package defining interfaces for authentication services to b [![Build Static](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml/badge.svg?branch=2.0)](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml) -[![Build Static](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml/badge.svg?branch=2.0)](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml) - [![SymfonyInsight](https://insight.symfony.com/projects/8a0dfa12-fdda-43d7-bdbe-1c6996b30c12/big.svg)](https://insight.symfony.com/projects/8a0dfa12-fdda-43d7-bdbe-1c6996b30c12) ## Installation