Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| Config | |
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getFunctions | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Engelsystem\Renderer\Twig\Extensions; |
| 6 | |
| 7 | use Engelsystem\Config\Config as EngelsystemConfig; |
| 8 | use Twig\Extension\AbstractExtension as TwigExtension; |
| 9 | use Twig\TwigFunction; |
| 10 | |
| 11 | class 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 | } |