1 | <?php |
||
19 | final class TemplateRegistry implements MutableTemplateRegistryInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var string[] |
||
23 | */ |
||
24 | private $templates = []; |
||
25 | |||
26 | /** |
||
27 | * @param string[] $templates |
||
28 | */ |
||
29 | public function __construct(array $templates = []) |
||
33 | |||
34 | /** |
||
35 | * @return string[] |
||
36 | */ |
||
37 | public function getTemplates(): array |
||
41 | |||
42 | /** |
||
43 | * @param string[] $templates |
||
44 | */ |
||
45 | public function setTemplates(array $templates) |
||
49 | |||
50 | public function hasTemplate(string $name): bool |
||
54 | |||
55 | /** |
||
56 | * @param string $name |
||
57 | */ |
||
58 | public function getTemplate($name): ?string |
||
77 | |||
78 | public function setTemplate($name, $template) |
||
82 | } |
||
83 |
If you suppress an error, we recommend checking for the error condition explicitly: