Total Complexity | 4 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Coverage | 90.91% |
Changes | 0 |
1 | <?php |
||
9 | class TwigEnvironmentProvider implements TwigEnvironmentProviderInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var \Twig_Environment |
||
13 | */ |
||
14 | private $twig; |
||
15 | |||
16 | /** |
||
17 | * @var \Xervice\Twig\Business\Twig\Extensions\TwigExtensionCollection |
||
18 | */ |
||
19 | private $extensions; |
||
20 | |||
21 | /** |
||
22 | * TwigEnvironmentProvider constructor. |
||
23 | * |
||
24 | * @param \Twig_LoaderInterface $loader |
||
25 | * @param \Xervice\Twig\Business\Twig\Extensions\TwigExtensionCollection $extensions |
||
26 | * @param array $config |
||
27 | */ |
||
28 | 2 | public function __construct( |
|
34 | 2 | } |
|
35 | |||
36 | /** |
||
37 | * @return \Twig_Environment |
||
38 | */ |
||
39 | 2 | public function getTwigEnvironment(): \Twig_Environment |
|
40 | { |
||
41 | 2 | $this->twig = $this->registerExtensions($this->twig); |
|
42 | |||
43 | 2 | return $this->twig; |
|
44 | } |
||
45 | |||
46 | /** |
||
47 | * @param $twig |
||
48 | * |
||
49 | * @return \Twig_Environment |
||
50 | */ |
||
51 | 2 | protected function registerExtensions($twig): \Twig_Environment |
|
57 | } |
||
58 | |||
60 | } |