Skip to content

Commit

Permalink
Added deprecation warnings when using the UserManager as user provider
Browse files Browse the repository at this point in the history
The dedicated user providers should be used instead.
  • Loading branch information
stof committed May 25, 2013
1 parent 8d06ec0 commit 1d4ffd8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Model/UserManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ public function findUserByConfirmationToken($token)
*/
public function refreshUser(SecurityUserInterface $user)
{
trigger_error(E_USER_DEPRECATED, 'Using the UserManager as user provider is deprecated. Use FOS\UserBundle\Security\UserProvider instead.');

$class = $this->getClass();
if (!$user instanceof $class) {
throw new UnsupportedUserException('Account is not supported.');
Expand Down Expand Up @@ -152,6 +154,8 @@ public function refreshUser(SecurityUserInterface $user)
*/
public function loadUserByUsername($username)
{
trigger_error(E_USER_DEPRECATED, 'Using the UserManager as user provider is deprecated. Use FOS\UserBundle\Security\UserProvider instead.');

$user = $this->findUserByUsername($username);

if (!$user) {
Expand Down Expand Up @@ -216,6 +220,8 @@ protected function getEncoder(UserInterface $user)
*/
public function supportsClass($class)
{
trigger_error(E_USER_DEPRECATED, 'Using the UserManager as user provider is deprecated. Use FOS\UserBundle\Security\UserProvider instead.');

return $class === $this->getClass();
}
}

0 comments on commit 1d4ffd8

Please sign in to comment.