| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 43 | public function getCurrentUser() |
||
| 44 | { |
||
| 45 | $token = $this->tokenStorage->getToken(); |
||
| 46 | |||
| 47 | if ($token === null) { |
||
| 48 | throw new LogicException('User cannot be retrieved: no token found'); |
||
| 49 | } |
||
| 50 | |||
| 51 | $user = $token->getUser(); |
||
| 52 | |||
| 53 | if ($user === null) { |
||
| 54 | throw new LogicException('User cannot be retrieved: user not found in token'); |
||
| 55 | } |
||
| 56 | |||
| 57 | return $user; |
||
| 58 | } |
||
| 59 | } |
||
| 60 |