Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
Config
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getFunctions
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Engelsystem\Renderer\Twig\Extensions;
6
7use Engelsystem\Config\Config as EngelsystemConfig;
8use Twig\Extension\AbstractExtension as TwigExtension;
9use Twig\TwigFunction;
10
11class Config extends TwigExtension
12{
13    public function __construct(protected EngelsystemConfig $config)
14    {
15    }
16
17    /**
18     * @return TwigFunction[]
19     */
20    public function getFunctions(): array
21    {
22        return [
23            new TwigFunction('config', [$this->config, 'get']),
24        ];
25    }
26}