Skip to content

Commit 1d4ffd8

Browse files
committed
Added deprecation warnings when using the UserManager as user provider
The dedicated user providers should be used instead.
1 parent 8d06ec0 commit 1d4ffd8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Model/UserManager.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ public function findUserByConfirmationToken($token)
124124
*/
125125
public function refreshUser(SecurityUserInterface $user)
126126
{
127+
trigger_error(E_USER_DEPRECATED, 'Using the UserManager as user provider is deprecated. Use FOS\UserBundle\Security\UserProvider instead.');
128+
127129
$class = $this->getClass();
128130
if (!$user instanceof $class) {
129131
throw new UnsupportedUserException('Account is not supported.');
@@ -152,6 +154,8 @@ public function refreshUser(SecurityUserInterface $user)
152154
*/
153155
public function loadUserByUsername($username)
154156
{
157+
trigger_error(E_USER_DEPRECATED, 'Using the UserManager as user provider is deprecated. Use FOS\UserBundle\Security\UserProvider instead.');
158+
155159
$user = $this->findUserByUsername($username);
156160

157161
if (!$user) {
@@ -216,6 +220,8 @@ protected function getEncoder(UserInterface $user)
216220
*/
217221
public function supportsClass($class)
218222
{
223+
trigger_error(E_USER_DEPRECATED, 'Using the UserManager as user provider is deprecated. Use FOS\UserBundle\Security\UserProvider instead.');
224+
219225
return $class === $this->getClass();
220226
}
221227
}

0 commit comments

Comments
 (0)