1 | <?php |
||
7 | class Renderer |
||
8 | { |
||
9 | /** |
||
10 | * Renderer configuration. |
||
11 | * |
||
12 | * @var array |
||
13 | */ |
||
14 | protected $config; |
||
15 | |||
16 | /** |
||
17 | * Page data to render. |
||
18 | * |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $data; |
||
22 | |||
23 | /** |
||
24 | * Cache adapter. |
||
25 | * |
||
26 | * @var \Journey\Cache\CacheAdapterIterface |
||
27 | */ |
||
28 | protected $cache; |
||
29 | |||
30 | /** |
||
31 | * String data to output. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $output; |
||
36 | |||
37 | /** |
||
38 | * Template engine. |
||
39 | * |
||
40 | * @var \League\Plates\Engine |
||
41 | */ |
||
42 | protected $engine; |
||
43 | |||
44 | /** |
||
45 | * Fields that are required in order to render. |
||
46 | * |
||
47 | * @var array |
||
48 | */ |
||
49 | protected $required; |
||
50 | |||
51 | /** |
||
52 | * Name of the current theme. |
||
53 | * |
||
54 | * @var array |
||
55 | */ |
||
56 | protected $theme; |
||
57 | |||
58 | /** |
||
59 | * Initialize our new renderer. |
||
60 | */ |
||
61 | 9 | public function __construct(array $config, array $data) |
|
72 | |||
73 | /** |
||
74 | * Register custom theme functions particular function. |
||
75 | * |
||
76 | * @return $this |
||
77 | */ |
||
78 | 9 | public function registerFunctions() |
|
83 | |||
84 | /** |
||
85 | * Add a single directory to the template engine. |
||
86 | * |
||
87 | * @param string $directories directory of templates |
||
|
|||
88 | * @return $this |
||
89 | */ |
||
90 | 3 | public function registerTheme($theme, $directory) |
|
99 | |||
100 | /** |
||
101 | * Returns the template rendering engine. |
||
102 | * |
||
103 | * @return League\Plates\Engine |
||
104 | */ |
||
105 | 1 | public function getEngine() |
|
109 | |||
110 | /** |
||
111 | * Get the page data that will be rendered. |
||
112 | * |
||
113 | * @return array |
||
114 | */ |
||
115 | 2 | public function getData() |
|
119 | |||
120 | /** |
||
121 | * Replace the page data |
||
122 | * |
||
123 | * @param array $data |
||
124 | */ |
||
125 | 9 | public function setData(array $data) |
|
131 | |||
132 | /** |
||
133 | * Validate that the page data is complete enough to render. |
||
134 | * |
||
135 | * Note: Throws an exception if the page data is incomplete. |
||
136 | * |
||
137 | * @param array $data array |
||
138 | * @return boolean |
||
139 | */ |
||
140 | 9 | public function validateData(array $data) |
|
147 | |||
148 | /** |
||
149 | * Generate wrapper classes for stripes |
||
150 | * |
||
151 | * @return string |
||
152 | */ |
||
153 | 3 | public function wrapperClasses($string) |
|
158 | |||
159 | /** |
||
160 | * Returns the image url on the vssl server. |
||
161 | * |
||
162 | * @param string $imageName hash.extension |
||
163 | * @param string $style image style name |
||
164 | * @return string |
||
165 | */ |
||
166 | 2 | public function image($name, $style = false) |
|
170 | |||
171 | /** |
||
172 | * Process data before its output. This is the last chance to make changes |
||
173 | * to data before being passed to the actual template files. |
||
174 | * |
||
175 | * @return array |
||
176 | */ |
||
177 | 3 | public function processData($data) |
|
187 | |||
188 | /** |
||
189 | * Render the current data. |
||
190 | * |
||
191 | * @return string |
||
192 | */ |
||
193 | 3 | public function render() |
|
197 | |||
198 | /** |
||
199 | * Return the rendered page. |
||
200 | * |
||
201 | * @return string |
||
202 | */ |
||
203 | 3 | public function __toString() |
|
211 | } |
||
212 |
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.