1 | <?php namespace Tarsana\Command\Template; |
||
13 | class TemplateLoader implements TemplateLoaderInterface { |
||
14 | |||
15 | /** |
||
16 | * Template loader providers classes. |
||
17 | * |
||
18 | * @var array |
||
19 | */ |
||
20 | protected static $providers = [ |
||
21 | 'twig' => 'Tarsana\Command\Template\Twig\TwigLoader' |
||
22 | ]; |
||
23 | |||
24 | /** |
||
25 | * Filesystem of the templates. |
||
26 | * |
||
27 | * @var Tarsana\IO\Interfaces\Filesystem |
||
28 | */ |
||
29 | protected $fs; |
||
30 | |||
31 | /** |
||
32 | * Array of template loaders. |
||
33 | * |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $loaders; |
||
37 | |||
38 | public function __construct(string $templatesPath, string $cachePath = null) |
||
42 | |||
43 | /** |
||
44 | * Initialize the loader. |
||
45 | * |
||
46 | * @param string $templatesPath |
||
47 | * @param string $cachePath |
||
48 | * @return self |
||
49 | */ |
||
50 | public function init(string $templatesPath, string $cachePath = null) : TemplateLoaderInterface |
||
63 | |||
64 | /** |
||
65 | * Load a template by name. The name is the relative |
||
66 | * path of the template file from the templates folder |
||
67 | * The name is given without extension; Exceptions are |
||
68 | * thrown if no file with supported extension is found |
||
69 | * or if many exists. |
||
70 | * |
||
71 | * @param string $name |
||
72 | * @return Tarsana\Command\Interfaces\TemplateInterface |
||
73 | * @throws Tarsana\Command\Exceptions\TemplateNotFound |
||
74 | * @throws Tarsana\Command\Exceptions\TemplateNameConflict |
||
75 | */ |
||
76 | public function load (string $name) : TemplateInterface |
||
108 | } |
||
109 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..