Checks whether a method/function call has too many arguments.
1 | <?php |
||
2 | |||
3 | if( ( $conf = config( 'shop.routes.admin', ['prefix' => 'admin', 'middleware' => ['web']] ) ) !== false ) { |
||
0 ignored issues
–
show
|
|||
4 | |||
5 | Route::group( $conf, function() { |
||
6 | |||
7 | Route::match( array( 'GET' ), '', array( |
||
8 | 'as' => 'aimeos_shop_admin', |
||
9 | 'uses' => 'Aimeos\Shop\Controller\AdminController@indexAction' |
||
10 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
11 | |||
12 | }); |
||
13 | } |
||
14 | |||
15 | |||
16 | if( ( $conf = config( 'shop.routes.jqadm', ['prefix' => 'admin/{site}/jqadm', 'middleware' => ['web', 'auth']] ) ) !== false ) { |
||
17 | |||
18 | Route::group( $conf, function() { |
||
19 | |||
20 | Route::match( array( 'GET' ), 'file/{name}/{locale}', array( |
||
21 | 'as' => 'aimeos_shop_jqadm_file', |
||
22 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@fileAction' |
||
23 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
24 | |||
25 | Route::match( array( 'POST' ), 'batch/{resource}', array( |
||
26 | 'as' => 'aimeos_shop_jqadm_batch', |
||
27 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@batchAction' |
||
28 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+', 'resource' => '[a-z\/]+'] ); |
||
29 | |||
30 | Route::match( array( 'GET', 'POST' ), 'copy/{resource}/{id}', array( |
||
31 | 'as' => 'aimeos_shop_jqadm_copy', |
||
32 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@copyAction' |
||
33 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+', 'resource' => '[a-z\/]+'] ); |
||
34 | |||
35 | Route::match( array( 'GET', 'POST' ), 'create/{resource}', array( |
||
36 | 'as' => 'aimeos_shop_jqadm_create', |
||
37 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@createAction' |
||
38 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+', 'resource' => '[a-z\/]+'] ); |
||
39 | |||
40 | Route::match( array( 'POST' ), 'delete/{resource}/{id?}', array( |
||
41 | 'as' => 'aimeos_shop_jqadm_delete', |
||
42 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@deleteAction' |
||
43 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+', 'resource' => '[a-z\/]+'] ); |
||
44 | |||
45 | Route::match( array( 'GET', 'POST' ), 'export/{resource}', array( |
||
46 | 'as' => 'aimeos_shop_jqadm_export', |
||
47 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@exportAction' |
||
48 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+', 'resource' => '[a-z\/]+'] ); |
||
49 | |||
50 | Route::match( array( 'GET' ), 'get/{resource}/{id}', array( |
||
51 | 'as' => 'aimeos_shop_jqadm_get', |
||
52 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@getAction' |
||
53 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+', 'resource' => '[a-z\/]+'] ); |
||
54 | |||
55 | Route::match( array( 'POST' ), 'import/{resource}', array( |
||
56 | 'as' => 'aimeos_shop_jqadm_import', |
||
57 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@importAction' |
||
58 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+', 'resource' => '[a-z\/]+'] ); |
||
59 | |||
60 | Route::match( array( 'POST' ), 'save/{resource}', array( |
||
61 | 'as' => 'aimeos_shop_jqadm_save', |
||
62 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@saveAction' |
||
63 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+', 'resource' => '[a-z\/]+'] ); |
||
64 | |||
65 | Route::match( array( 'GET', 'POST' ), 'search/{resource}', array( |
||
66 | 'as' => 'aimeos_shop_jqadm_search', |
||
67 | 'uses' => 'Aimeos\Shop\Controller\JqadmController@searchAction' |
||
68 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+', 'resource' => '[a-z\/]+'] ); |
||
69 | |||
70 | }); |
||
71 | } |
||
72 | |||
73 | |||
74 | if( ( $conf = config( 'shop.routes.graphql', ['prefix' => 'admin/{site}/graphql', 'middleware' => ['web', 'auth']] ) ) !== false ) { |
||
75 | |||
76 | Route::group( $conf, function() { |
||
77 | |||
78 | Route::match( array( 'POST' ), '', array( |
||
79 | 'as' => 'aimeos_shop_graphql_post', |
||
80 | 'uses' => 'Aimeos\Shop\Controller\GraphqlController@indexAction' |
||
81 | ) )->where( ['site' => '[A-Za-z0-9\.\-]+'] ); |
||
82 | |||
83 | }); |
||
84 | } |
||
85 | |||
86 | |||
87 | if( ( $conf = config( 'shop.routes.jsonadm', ['prefix' => 'admin/{site}/jsonadm', 'middleware' => ['web', 'auth']] ) ) !== false ) { |
||
88 | |||
89 | Route::group( $conf, function() { |
||
90 | |||
91 | Route::match( array( 'DELETE' ), '{resource}/{id?}', array( |
||
92 | 'as' => 'aimeos_shop_jsonadm_delete', |
||
93 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@deleteAction' |
||
94 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+', 'resource' => '[a-z\/]+'] ); |
||
95 | |||
96 | Route::match( array( 'GET' ), '{resource}/{id?}', array( |
||
97 | 'as' => 'aimeos_shop_jsonadm_get', |
||
98 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@getAction' |
||
99 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+', 'resource' => '[a-z\/]+'] ); |
||
100 | |||
101 | Route::match( array( 'PATCH' ), '{resource}/{id?}', array( |
||
102 | 'as' => 'aimeos_shop_jsonadm_patch', |
||
103 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@patchAction' |
||
104 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+', 'resource' => '[a-z\/]+'] ); |
||
105 | |||
106 | Route::match( array( 'POST' ), '{resource}/{id?}', array( |
||
107 | 'as' => 'aimeos_shop_jsonadm_post', |
||
108 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@postAction' |
||
109 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+', 'resource' => '[a-z\/]+'] ); |
||
110 | |||
111 | Route::match( array( 'PUT' ), '{resource}/{id?}', array( |
||
112 | 'as' => 'aimeos_shop_jsonadm_put', |
||
113 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@putAction' |
||
114 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+', 'resource' => '[a-z\/]+'] ); |
||
115 | |||
116 | Route::match( array( 'OPTIONS' ), '{resource?}', array( |
||
117 | 'as' => 'aimeos_shop_jsonadm_options', |
||
118 | 'uses' => 'Aimeos\Shop\Controller\JsonadmController@optionsAction' |
||
119 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+', 'resource' => '[a-z\/]+'] ); |
||
120 | |||
121 | }); |
||
122 | } |
||
123 | |||
124 | |||
125 | if( ( $conf = config( 'shop.routes.jsonapi', ['prefix' => 'jsonapi', 'middleware' => ['web', 'api']] ) ) !== false ) { |
||
126 | |||
127 | Route::group( $conf, function() { |
||
128 | |||
129 | Route::match( array( 'DELETE' ), '{resource}', array( |
||
130 | 'as' => 'aimeos_shop_jsonapi_delete', |
||
131 | 'uses' => 'Aimeos\Shop\Controller\JsonapiController@deleteAction' |
||
132 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
133 | |||
134 | Route::match( array( 'GET' ), '{resource}', array( |
||
135 | 'as' => 'aimeos_shop_jsonapi_get', |
||
136 | 'uses' => 'Aimeos\Shop\Controller\JsonapiController@getAction' |
||
137 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
138 | |||
139 | Route::match( array( 'PATCH' ), '{resource}', array( |
||
140 | 'as' => 'aimeos_shop_jsonapi_patch', |
||
141 | 'uses' => 'Aimeos\Shop\Controller\JsonapiController@patchAction' |
||
142 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
143 | |||
144 | Route::match( array( 'POST' ), '{resource}', array( |
||
145 | 'as' => 'aimeos_shop_jsonapi_post', |
||
146 | 'uses' => 'Aimeos\Shop\Controller\JsonapiController@postAction' |
||
147 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
148 | |||
149 | Route::match( array( 'PUT' ), '{resource}', array( |
||
150 | 'as' => 'aimeos_shop_jsonapi_put', |
||
151 | 'uses' => 'Aimeos\Shop\Controller\JsonapiController@putAction' |
||
152 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
153 | |||
154 | Route::match( array( 'GET', 'OPTIONS' ), '{resource?}', array( |
||
155 | 'as' => 'aimeos_shop_jsonapi_options', |
||
156 | 'uses' => 'Aimeos\Shop\Controller\JsonapiController@optionsAction' |
||
157 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
158 | |||
159 | }); |
||
160 | } |
||
161 | |||
162 | |||
163 | if( ( $conf = config( 'shop.routes.account', ['prefix' => 'profile', 'middleware' => ['web', 'auth']] ) ) !== false ) { |
||
164 | |||
165 | Route::group( $conf, function() { |
||
166 | |||
167 | Route::match( array( 'GET', 'POST' ), 'favorite/{fav_action?}/{fav_id?}/{d_name?}/{d_pos?}', array( |
||
168 | 'as' => 'aimeos_shop_account_favorite', |
||
169 | 'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction' |
||
170 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
171 | |||
172 | Route::match( array( 'GET', 'POST' ), 'watch/{wat_action?}/{wat_id?}/{d_name?}/{d_pos?}', array( |
||
173 | 'as' => 'aimeos_shop_account_watch', |
||
174 | 'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction' |
||
175 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
176 | |||
177 | Route::match( array( 'GET', 'POST' ), 'download/{dl_id}', array( |
||
178 | 'as' => 'aimeos_shop_account_download', |
||
179 | 'uses' => 'Aimeos\Shop\Controller\AccountController@downloadAction' |
||
180 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
181 | |||
182 | Route::match( array( 'GET', 'POST' ), '', array( |
||
183 | 'as' => 'aimeos_shop_account', |
||
184 | 'uses' => 'Aimeos\Shop\Controller\AccountController@indexAction' |
||
185 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
186 | |||
187 | }); |
||
188 | } |
||
189 | |||
190 | |||
191 | if( ( $conf = config( 'shop.routes.supplier', ['prefix' => 'brand', 'middleware' => ['web']] ) ) !== false ) { |
||
192 | |||
193 | Route::group( $conf, function() { |
||
194 | |||
195 | Route::match( array( 'GET', 'POST' ), '{s_name}/{f_supid}', array( |
||
196 | 'as' => 'aimeos_shop_supplier', |
||
197 | 'uses' => 'Aimeos\Shop\Controller\SupplierController@detailAction' |
||
198 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
199 | |||
200 | } ); |
||
201 | } |
||
202 | |||
203 | |||
204 | if( ( $conf = config( 'shop.routes.update', [] ) ) !== false ) { |
||
205 | |||
206 | Route::group( $conf, function() { |
||
207 | |||
208 | Route::match( array( 'GET', 'POST' ), 'update', array( |
||
209 | 'as' => 'aimeos_shop_update', |
||
210 | 'uses' => 'Aimeos\Shop\Controller\CheckoutController@updateAction' |
||
211 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
212 | |||
213 | }); |
||
214 | } |
||
215 | |||
216 | |||
217 | if( ( $conf = config( 'shop.routes.confirm', ['prefix' => 'shop', 'middleware' => ['web']] ) ) !== false ) { |
||
218 | |||
219 | Route::group( $conf, function() { |
||
220 | |||
221 | Route::match( array( 'GET', 'POST' ), 'confirm/{code?}', array( |
||
222 | 'as' => 'aimeos_shop_confirm', |
||
223 | 'uses' => 'Aimeos\Shop\Controller\CheckoutController@confirmAction' |
||
224 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
225 | |||
226 | }); |
||
227 | } |
||
228 | |||
229 | |||
230 | if( ( $conf = config( 'shop.routes.checkout', ['prefix' => 'shop', 'middleware' => ['web']] ) ) !== false ) { |
||
231 | |||
232 | Route::group( $conf, function() { |
||
233 | |||
234 | Route::match( array( 'GET', 'POST' ), 'checkout/{c_step?}', array( |
||
235 | 'as' => 'aimeos_shop_checkout', |
||
236 | 'uses' => 'Aimeos\Shop\Controller\CheckoutController@indexAction' |
||
237 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
238 | |||
239 | }); |
||
240 | } |
||
241 | |||
242 | |||
243 | if( ( $conf = config( 'shop.routes.basket', ['prefix' => 'shop', 'middleware' => ['web']] ) ) !== false ) { |
||
244 | |||
245 | Route::group( $conf, function() { |
||
246 | |||
247 | Route::match( array( 'GET', 'POST' ), 'basket', array( |
||
248 | 'as' => 'aimeos_shop_basket', |
||
249 | 'uses' => 'Aimeos\Shop\Controller\BasketController@indexAction' |
||
250 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
251 | |||
252 | }); |
||
253 | } |
||
254 | |||
255 | |||
256 | if( ( $conf = config( 'shop.routes.default', ['prefix' => 'shop', 'middleware' => ['web']] ) ) !== false ) { |
||
257 | |||
258 | Route::group( $conf, function() { |
||
259 | |||
260 | Route::match( array( 'GET', 'POST' ), 'count', array( |
||
261 | 'as' => 'aimeos_shop_count', |
||
262 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@countAction' |
||
263 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
264 | |||
265 | Route::match( array( 'GET', 'POST' ), 'suggest', array( |
||
266 | 'as' => 'aimeos_shop_suggest', |
||
267 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@suggestAction' |
||
268 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
269 | |||
270 | Route::match( array( 'GET', 'POST' ), 'stock', array( |
||
271 | 'as' => 'aimeos_shop_stock', |
||
272 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@stockAction' |
||
273 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
274 | |||
275 | Route::match( array( 'GET', 'POST' ), 'pin', array( |
||
276 | 'as' => 'aimeos_shop_session_pinned', |
||
277 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@sessionAction' |
||
278 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
279 | |||
280 | Route::match( array( 'GET', 'POST' ), 'search', array( |
||
281 | 'as' => 'aimeos_shop_list', |
||
282 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@listAction' |
||
283 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
284 | |||
285 | Route::match( array( 'GET', 'POST' ), '{f_name}~{f_catid}/{l_page?}', array( |
||
286 | 'as' => 'aimeos_shop_tree', |
||
287 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@treeAction' |
||
288 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+', 'f_name' => '[^~]*', 'l_page' => '[0-9]+'] ); |
||
289 | |||
290 | Route::match( array( 'GET', 'POST' ), '{d_name}/{d_pos?}/{d_prodid?}', array( |
||
291 | 'as' => 'aimeos_shop_detail', |
||
292 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@detailAction' |
||
293 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+', 'd_pos' => '[0-9]*'] ); |
||
294 | |||
295 | }); |
||
296 | } |
||
297 | |||
298 | |||
299 | if( ( $conf = config( 'shop.routes.page', ['prefix' => 'p', 'middleware' => ['web']] ) ) !== false ) { |
||
300 | |||
301 | Route::group( $conf, function() { |
||
302 | |||
303 | Route::match(['GET', 'POST'], '{path?}', [ |
||
304 | 'as' => 'aimeos_page', |
||
305 | 'uses' => '\Aimeos\Shop\Controller\PageController@indexAction' |
||
306 | ] )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
307 | }); |
||
308 | } |
||
309 | |||
310 | |||
311 | if( ( $conf = config( 'shop.routes.home', ['middleware' => ['web']] ) ) !== false ) { |
||
312 | |||
313 | Route::group( $conf, function() { |
||
314 | |||
315 | Route::match( array( 'GET', 'POST' ), '/', array( |
||
316 | 'as' => 'aimeos_home', |
||
317 | 'uses' => 'Aimeos\Shop\Controller\CatalogController@homeAction' |
||
318 | ) )->where( ['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+'] ); |
||
319 | |||
320 | }); |
||
321 | } |
||
322 |
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. Please note the @ignore annotation hint above.