1 | <?php |
||
21 | class Request |
||
22 | { |
||
23 | use \Jaxon\Utils\Traits\Config; |
||
24 | |||
25 | /** |
||
26 | * The prefix to prepend on each call |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $sPrefix; |
||
31 | |||
32 | /** |
||
33 | * Set the name of the class to call |
||
34 | * |
||
35 | * @param string|null $sClass The callable class |
||
36 | * |
||
37 | * @return Factory |
||
38 | */ |
||
39 | public function setClassName($sClass) |
||
54 | |||
55 | /** |
||
56 | * Set the callable object to call |
||
57 | * |
||
58 | * @param CallableObject $xCallable The callable object |
||
59 | * |
||
60 | * @return Factory |
||
61 | */ |
||
62 | public function setCallable(CallableObject $xCallable) |
||
68 | |||
69 | /** |
||
70 | * Return the javascript call to a Jaxon function or object method |
||
71 | * |
||
72 | * @param string $sFunction The function or method (without class) name |
||
73 | * @param ... $xParams The parameters of the function or method |
||
74 | * |
||
75 | * @return \Jaxon\Request\Request |
||
76 | */ |
||
77 | public function call($sFunction) |
||
97 | |||
98 | /** |
||
99 | * Return the javascript call to a generic function |
||
100 | * |
||
101 | * @param string $sFunction The function or method (with class) name |
||
102 | * @param ... $xParams The parameters of the function or method |
||
103 | * |
||
104 | * @return \Jaxon\Request\Request |
||
105 | */ |
||
106 | public function func($sFunction) |
||
118 | |||
119 | /** |
||
120 | * Make the pagination links for a registered Jaxon class method |
||
121 | * |
||
122 | * @param integer $nItemsTotal The total number of items |
||
123 | * @param integer $nItemsPerPage The number of items per page page |
||
124 | * @param integer $nCurrentPage The current page |
||
125 | * @param string $sMethod The name of function or a method prepended with its class name |
||
126 | * @param ... $xParams The parameters of the function or method |
||
127 | * |
||
128 | * @return string the pagination links |
||
129 | */ |
||
130 | public function paginate($nItemsTotal, $nItemsPerPage, $nCurrentPage, $sMethod) |
||
139 | |||
140 | /** |
||
141 | * Make a parameter of type Jaxon::FORM_VALUES |
||
142 | * |
||
143 | * @param string $sFormId The id of the HTML form |
||
144 | * |
||
145 | * @return Parameter |
||
146 | */ |
||
147 | public function form($sFormId) |
||
151 | |||
152 | /** |
||
153 | * Make a parameter of type Jaxon::INPUT_VALUE |
||
154 | * |
||
155 | * @param string $sInputId the id of the HTML input element |
||
156 | * |
||
157 | * @return Parameter |
||
158 | */ |
||
159 | public function input($sInputId) |
||
163 | |||
164 | /** |
||
165 | * Make a parameter of type Jaxon::CHECKED_VALUE |
||
166 | * |
||
167 | * @param string $sInputId the name of the HTML form element |
||
168 | * |
||
169 | * @return Parameter |
||
170 | */ |
||
171 | public function checked($sInputId) |
||
175 | |||
176 | /** |
||
177 | * Make a parameter of type Jaxon::CHECKED_VALUE |
||
178 | * |
||
179 | * @param string $sInputId the name of the HTML form element |
||
180 | * |
||
181 | * @return Parameter |
||
182 | */ |
||
183 | public function select($sInputId) |
||
187 | |||
188 | /** |
||
189 | * Make a parameter of type Jaxon::ELEMENT_INNERHTML |
||
190 | * |
||
191 | * @param string $sElementId the id of the HTML element |
||
192 | * |
||
193 | * @return Parameter |
||
194 | */ |
||
195 | public function html($sElementId) |
||
199 | |||
200 | /** |
||
201 | * Make a parameter of type Jaxon::QUOTED_VALUE |
||
202 | * |
||
203 | * @param string $sValue the value of the parameter |
||
204 | * |
||
205 | * @return Parameter |
||
206 | */ |
||
207 | public function string($sValue) |
||
211 | |||
212 | /** |
||
213 | * Make a parameter of type Jaxon::NUMERIC_VALUE |
||
214 | * |
||
215 | * @param numeric $nValue the value of the parameter |
||
216 | * |
||
217 | * @return Parameter |
||
218 | */ |
||
219 | public function numeric($nValue) |
||
223 | |||
224 | /** |
||
225 | * Make a parameter of type Jaxon::NUMERIC_VALUE |
||
226 | * |
||
227 | * @param numeric $nValue the value of the parameter |
||
228 | * |
||
229 | * @return Parameter |
||
230 | */ |
||
231 | public function int($nValue) |
||
235 | |||
236 | /** |
||
237 | * Make a parameter of type Jaxon::JS_VALUE |
||
238 | * |
||
239 | * @param string $sValue the javascript code of the parameter |
||
240 | * |
||
241 | * @return Parameter |
||
242 | */ |
||
243 | public function javascript($sValue) |
||
247 | |||
248 | /** |
||
249 | * Make a parameter of type Jaxon::JS_VALUE |
||
250 | * |
||
251 | * @param string $sValue the javascript code of the parameter |
||
252 | * |
||
253 | * @return Parameter |
||
254 | */ |
||
255 | public function js($sValue) |
||
259 | |||
260 | /** |
||
261 | * Make a parameter of type Jaxon::PAGE_NUMBER |
||
262 | * |
||
263 | * @return Parameter |
||
264 | */ |
||
265 | public function page() |
||
270 | } |
||
271 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.