| Total Complexity | 5 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class TwigRendererAdapter implements RendererAdapterInterface |
||
| 12 | { |
||
| 13 | protected Engine $engine; |
||
| 14 | |||
| 15 | 3 | public function __construct( |
|
| 16 | protected string $viewPath, |
||
| 17 | protected ?string $cachePath = null, |
||
| 18 | ) {} |
||
| 19 | |||
| 20 | /** |
||
| 21 | * {@inheritdoc} |
||
| 22 | */ |
||
| 23 | 1 | public function exists(string $name): bool |
|
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * {@inheritdoc} |
||
| 30 | */ |
||
| 31 | 2 | public function render(string $name, array $params = []): string |
|
| 32 | { |
||
| 33 | 2 | return $this->getEngine()->render($name, $params); |
|
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Get the Twig template Engine. |
||
| 38 | */ |
||
| 39 | 3 | protected function getEngine(): Engine |
|
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Create the Twig template Engine. |
||
| 46 | */ |
||
| 47 | 3 | protected function createEngine(): Engine |
|
| 52 | ); |
||
| 53 | } |
||
| 55 |