Skip to content

Commit

Permalink
Merge pull request #2494 from tarlepp/chore(cleanup)/more-specific-ty…
Browse files Browse the repository at this point in the history
…pes-etc

Chore(cleanup) - Added more specific types to `UserTypeIdentification` service
  • Loading branch information
tarlepp committed Nov 5, 2023
2 parents 1e3421d + 26b369f commit 817d113
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Security/UserTypeIdentification.php
Expand Up @@ -58,7 +58,7 @@ public function getUser(): ?User
/**
* Helper method to get user identity object via token storage.
*/
public function getIdentity(): ?UserInterface
public function getIdentity(): SecurityUser|ApiKeyUser|null
{
return $this->getSecurityUser() ?? $this->getApiKeyUser();
}
Expand Down Expand Up @@ -88,10 +88,8 @@ public function getSecurityUser(): ?SecurityUser
* object implementing a __toString method, or the username as a regular
* string.
*/
private function getUserToken(): UserInterface | null
private function getUserToken(): UserInterface|null
{
$token = $this->tokenStorage->getToken();

return $token?->getUser();
return $this->tokenStorage->getToken()?->getUser();
}
}

0 comments on commit 817d113

Please sign in to comment.