Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4628689

Browse files
committed
[FrameworkBundle] Fix incompatibility with 6.0
1 parent 98328ad commit 4628689

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ public function loginUser(object $user, string $firewallContext = 'main'): self
123123
}
124124

125125
$token = new TestBrowserToken($user->getRoles(), $user, $firewallContext);
126-
$token->setAuthenticated(true, false);
126+
// @deprecated since Symfony 5.4
127+
if (method_exists($token, 'isAuthenticated')) {
128+
$token->setAuthenticated(true, false);
129+
}
127130

128131
$container = $this->getContainer();
129132
$container->get('security.untracked_token_storage')->setToken($token);

0 commit comments

Comments
 (0)