1 | <?php |
||
21 | private iterable $iterator; |
||
22 | |||
23 | /** |
||
24 | * @param iterable<string> $iterator |
||
25 | */ |
||
26 | 3 | public function __construct(Environment $twig, iterable $iterator) |
|
27 | { |
||
28 | 3 | $this->twig = $twig; |
|
29 | 3 | $this->iterator = $iterator; |
|
30 | 3 | } |
|
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | 2 | public function warmUp(string $cacheDir): array |
|
36 | { |
||
37 | 2 | foreach ($this->iterator as $template) { |
|
38 | try { |
||
39 | 2 | $this->twig->load($template); |
|
40 | 1 | } catch (Error $error) { |
|
41 | // noop |
||
42 | } |
||
43 | } |
||
44 | |||
45 | 2 | return []; |
|
46 | } |
||
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | 1 | public function isOptional(): bool |
|
52 | { |
||
53 | 1 | return true; |
|
54 | } |
||
56 |