Total Complexity | 4 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class LocaleLink implements ExtensionInterface |
||
10 | { |
||
11 | /** @var bool $enabled */ |
||
12 | private $enabled; |
||
13 | |||
14 | /** |
||
15 | * LocaleLink constructor. |
||
16 | * @param bool $enabled |
||
17 | */ |
||
18 | 5 | public function __construct(bool $enabled) |
|
21 | 5 | } |
|
22 | |||
23 | /** |
||
24 | * @param Engine $engine |
||
25 | */ |
||
26 | 4 | public function register(Engine $engine) |
|
27 | { |
||
28 | 4 | $engine->registerFunction('l', [$this, 'locale']); |
|
29 | 4 | $engine->registerFunction('locale', [$this, 'locale']); |
|
30 | 4 | } |
|
31 | |||
32 | /** |
||
33 | * @return string |
||
34 | */ |
||
35 | 1 | public function locale() : string |
|
38 | } |
||
39 | } |
||
40 |