Skip to content

Commit 10dd6c0

Browse files
Merge branch '5.4' into 6.0
* 5.4: [Security] make TokenInterface::getUser() nullable to tell about unauthenticated tokens [Messenger] fix compat with Serializer v6
2 parents 7fbce4d + 1ccb6ba commit 10dd6c0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

AppVariable.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\HttpFoundation\Session\Session;
1717
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
1818
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
19+
use Symfony\Component\Security\Core\User\UserInterface;
1920

2021
/**
2122
* Exposes some Symfony parameters and services as an "app" global variable.
@@ -68,7 +69,7 @@ public function getToken(): ?TokenInterface
6869
*
6970
* @see TokenInterface::getUser()
7071
*/
71-
public function getUser(): ?object
72+
public function getUser(): ?UserInterface
7273
{
7374
if (null === $tokenStorage = $this->tokenStorage) {
7475
throw new \RuntimeException('The "app.user" variable is not available.');

0 commit comments

Comments
 (0)