| Total Complexity | 8 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | final class TwigPage implements TwigPageInterface |
||
| 13 | { |
||
| 14 | private Environment $environment; |
||
| 15 | |||
| 16 | private ?TemplateWrapper $template = null; |
||
| 17 | |||
| 18 | private bool $isTemplateSet = false; |
||
| 19 | |||
| 20 | /** @var array<mixed> */ |
||
| 21 | private array $variables = []; |
||
| 22 | |||
| 23 | public function __construct( |
||
| 24 | Environment $environment |
||
| 25 | ) { |
||
| 26 | $this->environment = $environment; |
||
| 27 | } |
||
| 28 | |||
| 29 | public function setVar(string $var, mixed $value): void |
||
| 30 | { |
||
| 31 | $this->variables[$var] = $value; |
||
| 32 | } |
||
| 33 | |||
| 34 | public function setTemplate(string $file): void |
||
| 35 | { |
||
| 36 | $this->loadTemplate($file); |
||
| 37 | $this->isTemplateSet = true; |
||
| 38 | } |
||
| 39 | |||
| 40 | public function isTemplateSet(): bool |
||
| 41 | { |
||
| 42 | return $this->isTemplateSet; |
||
| 43 | } |
||
| 44 | |||
| 45 | public function render(): string |
||
| 52 | } |
||
| 53 | |||
| 54 | private function loadTemplate(string $file): TemplateWrapper |
||
| 55 | { |
||
| 61 | } |
||
| 62 | } |
||
| 63 |