1 | <?php |
||
23 | abstract class Base |
||
24 | { |
||
25 | private $view; |
||
26 | private $context; |
||
27 | private $templatePaths; |
||
28 | private $path; |
||
29 | |||
30 | |||
31 | /** |
||
32 | * Initializes the client |
||
33 | * |
||
34 | * @param \Aimeos\MShop\Context\Item\Iface $context MShop context object |
||
35 | * @param \Aimeos\MW\View\Iface $view View object |
||
36 | * @param array $templatePaths List of file system paths where the templates are stored |
||
37 | * @param string $path Name of the client separated by slashes, e.g "catalog/lists" |
||
38 | */ |
||
39 | public function __construct( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MW\View\Iface $view, array $templatePaths, $path ) |
||
46 | |||
47 | |||
48 | /** |
||
49 | * Catch unknown methods |
||
50 | * |
||
51 | * @param string $name Name of the method |
||
52 | * @param array $param List of method parameter |
||
53 | * @throws \Aimeos\Client\JsonApi\Exception If method call failed |
||
54 | */ |
||
55 | public function __call( $name, array $param ) |
||
59 | |||
60 | |||
61 | /** |
||
62 | * Deletes the resource or the resource list |
||
63 | * |
||
64 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
||
65 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
||
66 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
||
67 | */ |
||
68 | public function delete( ServerRequestInterface $request, ResponseInterface $response ) |
||
72 | |||
73 | |||
74 | /** |
||
75 | * Retrieves the resource or the resource list |
||
76 | * |
||
77 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
||
78 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
||
79 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
||
80 | */ |
||
81 | public function get( ServerRequestInterface $request, ResponseInterface $response ) |
||
85 | |||
86 | |||
87 | /** |
||
88 | * Updates the resource or the resource list partitially |
||
89 | * |
||
90 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
||
91 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
||
92 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
||
93 | */ |
||
94 | public function patch( ServerRequestInterface $request, ResponseInterface $response ) |
||
98 | |||
99 | |||
100 | /** |
||
101 | * Creates or updates the resource or the resource list |
||
102 | * |
||
103 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
||
104 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
||
105 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
||
106 | */ |
||
107 | public function post( ServerRequestInterface $request, ResponseInterface $response ) |
||
111 | |||
112 | |||
113 | /** |
||
114 | * Creates or updates the resource or the resource list |
||
115 | * |
||
116 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
||
117 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
||
118 | * @param string|null $prefix Form parameter prefix when nesting parameters is required |
||
|
|||
119 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
||
120 | */ |
||
121 | public function put( ServerRequestInterface $request, ResponseInterface $response ) |
||
125 | |||
126 | |||
127 | /** |
||
128 | * Creates or updates the resource or the resource list |
||
129 | * |
||
130 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
||
131 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
||
132 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
||
133 | */ |
||
134 | public function options( ServerRequestInterface $request, ResponseInterface $response, $prefix = null ) |
||
138 | |||
139 | |||
140 | /** |
||
141 | * Returns the default response for the resource |
||
142 | * |
||
143 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
||
144 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
||
145 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
||
146 | */ |
||
147 | protected function defaultAction( ServerRequestInterface $request, ResponseInterface $response ) |
||
189 | |||
190 | |||
191 | /** |
||
192 | * Returns the context item object |
||
193 | * |
||
194 | * @return \Aimeos\MShop\Context\Item\Iface Context object |
||
195 | */ |
||
196 | protected function getContext() |
||
200 | |||
201 | |||
202 | /** |
||
203 | * Returns the translated title and the details of the error |
||
204 | * |
||
205 | * @param \Exception $e Thrown exception |
||
206 | * @param string|null $domain Translation domain |
||
207 | * @return array Associative list with "title" and "detail" key (if debug config is enabled) |
||
208 | */ |
||
209 | protected function getErrorDetails( \Exception $e, $domain = null ) |
||
225 | |||
226 | |||
227 | /** |
||
228 | * Returns the path to the client |
||
229 | * |
||
230 | * @return string Client path, e.g. "product/property" |
||
231 | */ |
||
232 | protected function getPath() |
||
236 | |||
237 | |||
238 | /** |
||
239 | * Returns the paths to the template files |
||
240 | * |
||
241 | * @return array List of file system paths |
||
242 | */ |
||
243 | protected function getTemplatePaths() |
||
247 | |||
248 | |||
249 | /** |
||
250 | * Returns the view object |
||
251 | * |
||
252 | * @return \Aimeos\MW\View\Iface View object |
||
253 | */ |
||
254 | protected function getView() |
||
258 | |||
259 | |||
260 | /** |
||
261 | * Initializes the criteria object based on the given parameter |
||
262 | * |
||
263 | * @param \Aimeos\MW\Criteria\Iface $criteria Criteria object |
||
264 | * @param array $params List of criteria data with condition, sorting and paging |
||
265 | * @return \Aimeos\MW\Criteria\Iface Initialized criteria object |
||
266 | */ |
||
267 | protected function initCriteria( \Aimeos\MW\Criteria\Iface $criteria, array $params ) |
||
275 | |||
276 | |||
277 | /** |
||
278 | * Initializes the criteria object with conditions based on the given parameter |
||
279 | * |
||
280 | * @param \Aimeos\MW\Criteria\Iface $criteria Criteria object |
||
281 | * @param array $params List of criteria data with condition, sorting and paging |
||
282 | * @return \Aimeos\MW\Criteria\Iface Initialized criteria object |
||
283 | */ |
||
284 | protected function initCriteriaConditions( \Aimeos\MW\Criteria\Iface $criteria, array $params ) |
||
296 | |||
297 | |||
298 | /** |
||
299 | * Initializes the criteria object with the slice based on the given parameter. |
||
300 | * |
||
301 | * @param \Aimeos\MW\Criteria\Iface $criteria Criteria object |
||
302 | * @param array $params List of criteria data with condition, sorting and paging |
||
303 | * @return \Aimeos\MW\Criteria\Iface Initialized criteria object |
||
304 | */ |
||
305 | protected function initCriteriaSlice( \Aimeos\MW\Criteria\Iface $criteria, array $params ) |
||
312 | |||
313 | |||
314 | /** |
||
315 | * Initializes the criteria object with sortations based on the given parameter |
||
316 | * |
||
317 | * @param \Aimeos\MW\Criteria\Iface $criteria Criteria object |
||
318 | * @param array $params List of criteria data with condition, sorting and paging |
||
319 | * @return \Aimeos\MW\Criteria\Iface Initialized criteria object |
||
320 | */ |
||
321 | protected function initCriteriaSortations( \Aimeos\MW\Criteria\Iface $criteria, array $params ) |
||
340 | } |
||
341 |
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.