| Total Complexity | 9 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Coverage | 93.75% |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | final class TwigPage implements TwigPageInterface |
||
| 13 | { |
||
| 14 | private ?string $template = null; |
||
| 15 | |||
| 16 | /** @var array<mixed> */ |
||
| 17 | private array $variables = []; |
||
| 18 | |||
| 19 | 5 | public function __construct(private Environment $environment) {} |
|
| 20 | |||
| 21 | 5 | #[Override] |
|
| 22 | public function setVar(string $var, mixed $value, bool $isGlobal = false): void |
||
| 23 | 2 | { |
|
| 24 | if ($isGlobal) { |
||
| 25 | $this->environment->addGlobal($var, $value); |
||
| 26 | 2 | } else { |
|
| 27 | 1 | $this->variables[$var] = $value; |
|
| 28 | } |
||
| 29 | 1 | } |
|
| 30 | |||
| 31 | #[Override] |
||
| 32 | public function setTemplate(string $file): void |
||
| 33 | 3 | { |
|
| 34 | $this->template = $file; |
||
| 35 | } |
||
| 36 | 3 | ||
| 37 | #[Override] |
||
| 38 | public function isTemplateSet(): bool |
||
| 39 | 1 | { |
|
| 40 | return $this->template !== null; |
||
| 41 | } |
||
| 42 | 1 | ||
| 43 | #[Override] |
||
| 47 | } |
||
| 48 | 2 | ||
| 49 | private function loadTemplate(): TemplateWrapper |
||
| 50 | { |
||
| 51 | 2 | if ($this->template === null) { |
|
| 52 | throw new RuntimeException('render not possible if template is not set'); |
||
| 53 | 2 | } |
|
| 54 | |||
| 55 | return $this->environment->load($this->template); |
||
| 56 | } |
||
| 57 | 2 | ||
| 58 | public function resetVariables(): void |
||
| 62 | } |
||
| 63 | } |
||
| 64 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths