| Total Complexity | 3 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class TwigDependencyProvider extends AbstractDependencyProvider |
||
| 15 | { |
||
| 16 | public const PATH_PROVIDER_COLLECTION = 'path.provider.collection'; |
||
| 17 | public const TWIG_EXTENSIONS = 'twig.extensions'; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param \Xervice\Core\Business\Model\Dependency\DependencyContainerInterface $container |
||
| 21 | * |
||
| 22 | * @return \Xervice\Core\Business\Model\Dependency\DependencyContainerInterface |
||
| 23 | */ |
||
| 24 | 2 | public function handleDependencies(DependencyContainerInterface $container): DependencyContainerInterface |
|
| 25 | { |
||
| 26 | $container[self::PATH_PROVIDER_COLLECTION] = function () { |
||
| 27 | 2 | return new PathCollection( |
|
| 28 | 2 | $this->getPathProviderList() |
|
| 29 | ); |
||
| 30 | }; |
||
| 31 | |||
| 32 | $container[self::TWIG_EXTENSIONS] = function () { |
||
| 33 | 2 | return new TwigExtensionCollection( |
|
| 34 | 2 | $this->getTwigExtensions() |
|
| 35 | ); |
||
| 36 | }; |
||
| 37 | |||
| 38 | 2 | return $container; |
|
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @return \Xervice\Twig\Business\Dependency\Path\PathProviderInterface[] |
||
| 43 | */ |
||
| 44 | 2 | protected function getPathProviderList(): array |
|
| 45 | { |
||
| 46 | return [ |
||
| 47 | 2 | new XervicePathProvider() |
|
| 48 | ]; |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @return \Xervice\Twig\Business\Dependency\Twig\Extensions\TwigExtensionInterface[] |
||
| 53 | */ |
||
| 54 | 2 | protected function getTwigExtensions(): array |
|
| 57 | } |
||
| 58 | } |