Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
40 | public function getLocaleCode() |
||
41 | { |
||
42 | $token = $this->tokenStorage->getToken(); |
||
43 | if (null === $token) { |
||
44 | throw new LocaleNotFoundException(); |
||
45 | } |
||
46 | |||
47 | $user = $token->getUser(); |
||
48 | if (!$user instanceof AdminUserInterface) { |
||
49 | throw new LocaleNotFoundException(); |
||
50 | } |
||
51 | |||
52 | return $user->getLocaleCode(); |
||
53 | } |
||
54 | } |
||
55 |