| Total Complexity | 3 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | trait TwigEngineMethods |
||
| 24 | { |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @inheritDoc |
||
| 28 | */ |
||
| 29 | public function update(TemplateEngineInterface $engine): void |
||
| 30 | { |
||
| 31 | if ($engine instanceof TwigTemplateEngine) { |
||
| 32 | /** @var ExtensionInterface $class */ |
||
| 33 | $class = $this->twigExtensionName; |
||
| 34 | $engine->sourceEngine()->addExtension(new $class()); |
||
| 35 | } |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @inheritDoc |
||
| 40 | */ |
||
| 41 | public function appliesTo(TemplateEngineInterface $engine): bool |
||
| 44 | } |
||
| 45 | } |
||
| 46 |