1 | <?php |
||
44 | class Template |
||
45 | { |
||
46 | /** |
||
47 | * The template path. |
||
48 | * @var array |
||
49 | */ |
||
50 | protected $path; |
||
51 | |||
52 | /** |
||
53 | * The template's data. |
||
54 | * Usually set from the View. |
||
55 | * @var array |
||
56 | */ |
||
57 | protected $data = []; |
||
58 | |||
59 | /** |
||
60 | * Initialize the template. |
||
61 | * |
||
62 | * @param string $name The template (file)name. |
||
63 | * |
||
64 | * @throws Exceptions\TemplateFileMissingException |
||
65 | */ |
||
66 | public function __construct($name) |
||
78 | |||
79 | /** |
||
80 | * Magic method to return the data. |
||
81 | * |
||
82 | * @param string $name |
||
83 | * |
||
84 | * @return mixed |
||
85 | */ |
||
86 | public function __get($name) |
||
90 | |||
91 | /** |
||
92 | * Not so magic method to return the data. |
||
93 | * |
||
94 | * @param string $name |
||
95 | * |
||
96 | * @return mixed |
||
97 | */ |
||
98 | public function get($name) |
||
106 | |||
107 | /** |
||
108 | * Assign an array as the template's data. |
||
109 | * Usually set from the View. |
||
110 | * |
||
111 | * @param array $data |
||
112 | * |
||
113 | * @return $this |
||
114 | */ |
||
115 | public function assign($data = []) |
||
120 | |||
121 | /** |
||
122 | * Render the template. |
||
123 | * |
||
124 | * @param array $data |
||
125 | */ |
||
126 | public function render($data = []) |
||
131 | } |
||
132 |
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..