|
14 | 14 | use FOS\UserBundle\Util\CanonicalizerInterface;
|
15 | 15 | use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface;
|
16 | 16 | use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;
|
17 |
| -use Symfony\Component\Security\Core\Exception\UnsupportedUserException; |
18 |
| -use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; |
19 |
| -use Symfony\Component\Security\Core\User\UserInterface as SecurityUserInterface; |
20 |
| -use Symfony\Component\Security\Core\User\UserProviderInterface; |
21 | 17 |
|
22 | 18 | /**
|
23 | 19 | * Abstract User Manager implementation which can be used as base class for your
|
24 | 20 | * concrete manager.
|
25 | 21 | *
|
26 | 22 | * @author Johannes M. Schmitt <[email protected]>
|
27 | 23 | */
|
28 |
| -abstract class UserManager implements UserManagerInterface, UserProviderInterface |
| 24 | +abstract class UserManager implements UserManagerInterface |
29 | 25 | {
|
30 | 26 | /**
|
31 | 27 | * @var EncoderFactoryInterface
|
@@ -103,49 +99,6 @@ public function findUserByConfirmationToken($token)
|
103 | 99 | return $this->findUserBy(array('confirmationToken' => $token));
|
104 | 100 | }
|
105 | 101 |
|
106 |
| - /** |
107 |
| - * {@inheritdoc} |
108 |
| - * |
109 |
| - * @deprecated Use FOS\UserBundle\Security\UserProvider instead |
110 |
| - */ |
111 |
| - public function refreshUser(SecurityUserInterface $user) |
112 |
| - { |
113 |
| - @trigger_error('Using the UserManager as user provider is deprecated. Use FOS\UserBundle\Security\UserProvider instead.', E_USER_DEPRECATED); |
114 |
| - |
115 |
| - $class = $this->getClass(); |
116 |
| - if (!$user instanceof $class) { |
117 |
| - throw new UnsupportedUserException('Account is not supported.'); |
118 |
| - } |
119 |
| - if (!$user instanceof User) { |
120 |
| - throw new UnsupportedUserException(sprintf('Expected an instance of FOS\UserBundle\Model\User, but got "%s".', get_class($user))); |
121 |
| - } |
122 |
| - |
123 |
| - $refreshedUser = $this->findUserBy(array('id' => $user->getId())); |
124 |
| - if (null === $refreshedUser) { |
125 |
| - throw new UsernameNotFoundException(sprintf('User with ID "%d" could not be reloaded.', $user->getId())); |
126 |
| - } |
127 |
| - |
128 |
| - return $refreshedUser; |
129 |
| - } |
130 |
| - |
131 |
| - /** |
132 |
| - * {@inheritdoc} |
133 |
| - * |
134 |
| - * @deprecated Use FOS\UserBundle\Security\UserProvider instead |
135 |
| - */ |
136 |
| - public function loadUserByUsername($username) |
137 |
| - { |
138 |
| - @trigger_error('Using the UserManager as user provider is deprecated. Use FOS\UserBundle\Security\UserProvider instead.', E_USER_DEPRECATED); |
139 |
| - |
140 |
| - $user = $this->findUserByUsername($username); |
141 |
| - |
142 |
| - if (!$user) { |
143 |
| - throw new UsernameNotFoundException(sprintf('No user with name "%s" was found.', $username)); |
144 |
| - } |
145 |
| - |
146 |
| - return $user; |
147 |
| - } |
148 |
| - |
149 | 102 | /**
|
150 | 103 | * {@inheritdoc}
|
151 | 104 | */
|
@@ -200,15 +153,4 @@ protected function getEncoder(UserInterface $user)
|
200 | 153 | {
|
201 | 154 | return $this->encoderFactory->getEncoder($user);
|
202 | 155 | }
|
203 |
| - |
204 |
| - /** |
205 |
| - * {@inheritdoc} |
206 |
| - * @deprecated Use FOS\UserBundle\Security\UserProvider instead |
207 |
| - */ |
208 |
| - public function supportsClass($class) |
209 |
| - { |
210 |
| - @trigger_error('Using the UserManager as user provider is deprecated. Use FOS\UserBundle\Security\UserProvider instead.', E_USER_DEPRECATED); |
211 |
| - |
212 |
| - return $class === $this->getClass(); |
213 |
| - } |
214 | 156 | }
|
0 commit comments