Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | public function __construct(RouterInterface $router, $defaultLocale = "en") |
||
13 | { |
||
14 | $this->router = $router; |
||
15 | $this->available_locales = [$defaultLocale]; |
||
16 | |||
17 | $locales = $router->getRouteCollection()->get('obblm_locale_switch')->getRequirement('_locale'); |
||
18 | |||
19 | if($locales) { |
||
20 | $this->available_locales = explode('|', $locales); |
||
21 | } |
||
48 |