|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +namespace Tempest\View\Renderers; |
| 6 | + |
| 7 | +final readonly class TwigConfig |
| 8 | +{ |
| 9 | + /** |
| 10 | + * @see \Twig\Environment::__construct() |
| 11 | + */ |
| 12 | + public function __construct( |
| 13 | + public array $viewPaths = [], |
| 14 | + public ?string $cachePath = null, |
| 15 | + public bool $debug = false, |
| 16 | + public string $charset = 'utf-8', |
| 17 | + public bool $strictVariables = false, |
| 18 | + public string $autoescape = 'html', |
| 19 | + public ?bool $autoReload = null, |
| 20 | + public int $optimizations = -1, |
| 21 | + ) { |
| 22 | + } |
| 23 | + |
| 24 | + public function toArray(): array |
| 25 | + { |
| 26 | + return [ |
| 27 | + 'debug' => $this->debug, |
| 28 | + 'charset' => $this->charset, |
| 29 | + 'strict_variables' => $this->strictVariables, |
| 30 | + 'autoescape' => $this->autoescape, |
| 31 | + 'cache' => $this->cachePath ?: false, |
| 32 | + 'auto_reload' => $this->autoReload, |
| 33 | + 'optimizations' => $this->optimizations, |
| 34 | + ]; |
| 35 | + } |
| 36 | +} |
0 commit comments