Skip to content

Commit

Permalink
minor #26467 Add UsernameNotFoundException declaration to refreshUser…
Browse files Browse the repository at this point in the history
…(). (umulmrum)

This PR was squashed before being merged into the 4.1-dev branch (closes #26467).

Discussion
----------

Add UsernameNotFoundException declaration to refreshUser().

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | maybe
| New feature?  | maybe
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Symfony\Component\Security\Core\User\UserProviderInterface::refreshUser() does not declare that implementations may throw a UsernameNotFoundException, although a) it makes sense, as the user could have been deleted since the last load, and b) the ContextListener already handles the UsernameNotFoundException. So it looks like someone thought of this, but simply forgot the annotation.

Unsure if this is a bugfix or a feature, but as it doesn't change executed code, master should be soon enough.

Commits
-------

f7a0c46 Add UsernameNotFoundException declaration to refreshUser().
  • Loading branch information
fabpot committed Mar 10, 2018
2 parents aab5772 + f7a0c46 commit e0f79f6
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -57,7 +57,8 @@ public function loadUserByUsername($username);
*
* @return UserInterface
*
* @throws UnsupportedUserException if the user is not supported
* @throws UnsupportedUserException if the user is not supported
* @throws UsernameNotFoundException if the user is not found
*/
public function refreshUser(UserInterface $user);

Expand Down

0 comments on commit e0f79f6

Please sign in to comment.