Skip to content

Commit 22714af

Browse files
committed
[Security] Readd deprecated methods to the interfaces
1 parent cf9a178 commit 22714af

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

Authentication/RememberMe/PersistentTokenInterface.php

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

Authentication/Token/TokenInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,11 @@ 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+
* @return string
136+
*
137+
* @deprecated since Symfony 5.3, use getUserIdentifier() instead
138+
*/
139+
public function getUsername();
133140
}

User/UserInterface.php

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

User/UserProviderInterface.php

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

0 commit comments

Comments
 (0)