Skip to content

Commit 5105cdd

Browse files
dereuromarkADmad
andauthored
Apply suggestions from code review
Co-authored-by: ADmad <admad.coder@gmail.com>
1 parent 2ba7ed9 commit 5105cdd

2 files changed

Lines changed: 2 additions & 11 deletions

File tree

src/Authenticator/JwtAuthenticator.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,7 @@ public function __construct(?IdentifierInterface $identifier, array $config = []
7676
*/
7777
public function getIdentifier(): IdentifierInterface
7878
{
79-
if ($this->_identifier === null) {
80-
$this->_identifier = IdentifierFactory::create('Authentication.JwtSubject');
81-
}
82-
83-
return $this->_identifier;
79+
return $this->_identifier ??= IdentifierFactory::create('Authentication.JwtSubject');
8480
}
8581

8682
/**

src/Authenticator/TokenAuthenticator.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,7 @@ class TokenAuthenticator extends AbstractAuthenticator implements StatelessInter
4545
* @return \Authentication\Identifier\IdentifierInterface
4646
*/
4747
public function getIdentifier(): IdentifierInterface
48-
{
49-
if ($this->_identifier === null) {
50-
$this->_identifier = IdentifierFactory::create('Authentication.Token');
51-
}
52-
53-
return $this->_identifier;
48+
return $this->_identifier ??= IdentifierFactory::create('Authentication.Token');
5449
}
5550

5651
/**

0 commit comments

Comments
 (0)