1 | <?php |
||
9 | class CThemeEngine implements IThemeEngine, \Anax\DI\IInjectionAware |
||
10 | { |
||
11 | use \Anax\View\THelpers, |
||
12 | \Anax\TConfigure, |
||
13 | \Anax\DI\TInjectionAware; |
||
14 | |||
15 | |||
16 | |||
17 | /** |
||
18 | * Array with variables to provide to theme template files. |
||
19 | */ |
||
20 | protected $data = []; |
||
21 | |||
22 | |||
23 | |||
24 | /** |
||
25 | * Overwrite template file as defined in config. |
||
26 | */ |
||
27 | protected $template = null; |
||
28 | |||
29 | |||
30 | |||
31 | /** |
||
32 | * Set another template file to use. |
||
33 | * |
||
34 | * @param string $name of the template file. |
||
35 | * |
||
36 | * @return $this |
||
37 | */ |
||
38 | public function setTemplate($name) |
||
43 | |||
44 | |||
45 | |||
46 | /** |
||
47 | * Shortcut to set title. |
||
48 | * |
||
49 | * @param string $value of the variable. |
||
50 | * |
||
51 | * @return $this |
||
52 | */ |
||
53 | public function setTitle($value) |
||
57 | |||
58 | |||
59 | |||
60 | /** |
||
61 | * Set a base title which is appended to the page title. |
||
62 | * |
||
63 | * @param string $value of the variable. |
||
64 | * |
||
65 | * @return $this |
||
66 | */ |
||
67 | public function setBaseTitle($value) |
||
71 | |||
72 | |||
73 | |||
74 | /** |
||
75 | * Set a variable which will be exposed to the template files during render. |
||
76 | * |
||
77 | * @param string $which variable to set value of. |
||
78 | * @param mixed $value of the variable. |
||
79 | * |
||
80 | * @return $this |
||
81 | */ |
||
82 | public function setVariable($which, $value) |
||
87 | |||
88 | |||
89 | |||
90 | /** |
||
91 | * Append value to variable by making the variable an array. |
||
92 | * |
||
93 | * @param string $which variable to set value of. |
||
94 | * @param mixed $value of the variable. |
||
95 | * |
||
96 | * @return $this |
||
97 | */ |
||
98 | public function appendToVariable($which, $value) |
||
103 | |||
104 | |||
105 | |||
106 | /** |
||
107 | * Add frontmatter to be exposed to theme template file. |
||
108 | * |
||
109 | * @param array|null $matter to add. |
||
110 | * |
||
111 | * @return $this |
||
112 | */ |
||
113 | public function addFrontmatter($matter) |
||
118 | |||
119 | |||
120 | |||
121 | /** |
||
122 | * Get a value of a variable which will be exposed to the template files |
||
123 | * during render. |
||
124 | * |
||
125 | * @param string $which variable to get value of. |
||
126 | * |
||
127 | * @return mixed as value of variable, or null if value is not set. |
||
128 | */ |
||
129 | public function getVariable($which) |
||
139 | |||
140 | |||
141 | |||
142 | /** |
||
143 | * Add a stylesheet. |
||
144 | * |
||
145 | * @param string $uri to add. |
||
146 | * |
||
147 | * @return $this |
||
148 | */ |
||
149 | public function addStylesheet($uri) |
||
154 | |||
155 | |||
156 | |||
157 | /** |
||
158 | * Add a javascript asset. |
||
159 | * |
||
160 | * @param string $uri to add. |
||
161 | * |
||
162 | * @return $this |
||
163 | */ |
||
164 | public function addJavaScript($uri) |
||
169 | |||
170 | |||
171 | |||
172 | /** |
||
173 | * Set/clear a key/value from the configuration file. |
||
174 | * |
||
175 | * @param string $uri to add. |
||
|
|||
176 | * |
||
177 | * @return $this |
||
178 | */ |
||
179 | public function setConfigKey($key, $value) |
||
184 | |||
185 | |||
186 | |||
187 | /** |
||
188 | * Render the theme by applying the variables onto the template files. |
||
189 | * |
||
190 | * @return void |
||
191 | */ |
||
192 | public function render() |
||
225 | } |
||
226 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.