Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
54 | 3 | public function refreshUser(UserInterface $user) |
|
55 | { |
||
56 | 3 | if (!$this->supportsClass(get_class($user))) { |
|
57 | 1 | throw new UnsupportedUserException(); |
|
58 | } |
||
59 | |||
60 | 2 | $user = $this->repository->findOneByUsername($user->getUsername()); |
|
61 | |||
62 | 2 | if ($user === null) { |
|
63 | 1 | throw new UsernameNotFoundException(); |
|
64 | } |
||
65 | |||
66 | 1 | return $user; |
|
67 | } |
||
68 | } |
||
69 |