Skip to content

Commit 817d113

Browse files
authored
Merge pull request #2494 from tarlepp/chore(cleanup)/more-specific-types-etc
Chore(cleanup) - Added more specific types to `UserTypeIdentification` service
2 parents 1e3421d + 26b369f commit 817d113

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Security/UserTypeIdentification.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function getUser(): ?User
5858
/**
5959
* Helper method to get user identity object via token storage.
6060
*/
61-
public function getIdentity(): ?UserInterface
61+
public function getIdentity(): SecurityUser|ApiKeyUser|null
6262
{
6363
return $this->getSecurityUser() ?? $this->getApiKeyUser();
6464
}
@@ -88,10 +88,8 @@ public function getSecurityUser(): ?SecurityUser
8888
* object implementing a __toString method, or the username as a regular
8989
* string.
9090
*/
91-
private function getUserToken(): UserInterface | null
91+
private function getUserToken(): UserInterface|null
9292
{
93-
$token = $this->tokenStorage->getToken();
94-
95-
return $token?->getUser();
93+
return $this->tokenStorage->getToken()?->getUser();
9694
}
9795
}

0 commit comments

Comments
 (0)