| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 64 | 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 | 64 | if ($this->segment($scope)) { |
|
| 26 | 11 | 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 | 59 | return $scope->defaultLocale(); |
|
| 33 | } |
||
| 34 | |||
| 42 |