| Total Complexity | 3 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Coverage | 87.5% |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | class TwigFactory |
||
| 28 | { |
||
| 29 | private Config $config; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Logger instance reserved for potential future logging needs. |
||
| 33 | * |
||
| 34 | * Currently stored to preserve the constructor signature and allow |
||
| 35 | * easy integration of logging without introducing breaking changes. |
||
| 36 | */ |
||
| 37 | private LoggerInterface $logger; |
||
| 38 | |||
| 39 | private Builder $builder; |
||
| 40 | |||
| 41 | 1 | public function __construct( |
|
| 42 | Config $config, |
||
| 43 | LoggerInterface $logger, |
||
| 44 | Builder $builder |
||
| 45 | ) { |
||
| 46 | 1 | $this->config = $config; |
|
| 47 | 1 | $this->logger = $logger; |
|
| 48 | 1 | $this->builder = $builder; |
|
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Creates a Twig renderer instance. |
||
| 53 | * |
||
| 54 | * @param string|array|null $templatesPath Template path(s) (uses default config if null) |
||
| 55 | * @return Twig Configured renderer instance |
||
| 56 | */ |
||
| 57 | 1 | public function create(string|array|null $templatesPath = null): Twig |
|
| 64 | } |
||
| 65 | } |
||
| 66 |