Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
22 | 28 | 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 | 28 | if ($this->segment($scope)) return null; |
|
26 | |||
27 | // At this point if no locale segment is given and if in config the hidden_locale is set, |
||
28 | // we assume the locale is hidden. |
||
29 | // TODO account for domain specific hidden (default) locales |
||
30 | 13 | return $scope->defaultLocale(); |
|
31 | } |
||
32 | |||
39 | } |