Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
22 | public function get(Scope $scope, Config $config): ?Locale |
||
23 | { |
||
24 | // If a locale segment is found, it means locale is not hidden so we won't bother going further. |
||
25 | if ($this->segment($scope)) { |
||
26 | return null; |
||
27 | } |
||
28 | |||
29 | // At this point if no locale segment is given and if in config the hidden_locale is set, |
||
30 | // we assume the locale is hidden. |
||
31 | // TODO account for domain specific hidden (default) locales |
||
32 | return $scope->defaultLocale(); |
||
33 | } |
||
34 | |||
42 |