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

Skip to content

Commit c23455e

Browse files
committed
[Security] Readd deprecated methods to the interfaces
1 parent 45e1b1e commit c23455e

File tree

6 files changed

+29
-0
lines changed

6 files changed

+29
-0
lines changed

src/Symfony/Bridge/Doctrine/Security/User/UserLoaderInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,8 @@
2929
*/
3030
interface UserLoaderInterface
3131
{
32+
/**
33+
* @deprecated since Symfony 5.3, use loadUserByIdentifier() instead
34+
*/
35+
public function loadUserByUsername(string $username);
3236
}

src/Symfony/Component/Security/Core/Authentication/RememberMe/PersistentTokenInterface.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,9 @@ public function getTokenValue();
4848
* @return \DateTime
4949
*/
5050
public function getLastUsed();
51+
52+
/**
53+
* @deprecated since Symfony 5.3, use getUserIdentifier() instead
54+
*/
55+
public function getUsername();
5156
}

src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,9 @@ public function __serialize(): array;
130130
* Restores the object state from an array given by __serialize().
131131
*/
132132
public function __unserialize(array $data): void;
133+
134+
/**
135+
* @deprecated since Symfony 5.3, use getUserIdentifier() instead
136+
*/
137+
public function getUsername();
133138
}

src/Symfony/Component/Security/Core/User/UserInterface.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,9 @@ public function getSalt();
7878
* the plain-text password is stored on this object.
7979
*/
8080
public function eraseCredentials();
81+
82+
/**
83+
* @deprecated since Symfony 5.3, use getUserIdentifier() instead
84+
*/
85+
public function getUsername();
8186
}

src/Symfony/Component/Security/Core/User/UserProviderInterface.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,9 @@ public function refreshUser(UserInterface $user);
5757
* @return bool
5858
*/
5959
public function supportsClass(string $class);
60+
61+
/**
62+
* @deprecated since Symfony 5.3, use loadUserByIdentifier() instead
63+
*/
64+
public function loadUserByUsername(string $username);
6065
}

src/Symfony/Component/Security/Http/Tests/LoginLink/LoginLinkHandlerTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ public function createUser(TestLoginLinkHandlerUser $user): void
211211
$this->users[$user->getUserIdentifier()] = $user;
212212
}
213213

214+
public function loadUserByUsername($username): TestLoginLinkHandlerUser
215+
{
216+
return $this->loadUserByIdentifier($username);
217+
}
218+
214219
public function loadUserByIdentifier(string $userIdentifier): TestLoginLinkHandlerUser
215220
{
216221
if (!isset($this->users[$userIdentifier])) {

0 commit comments

Comments
 (0)