Issues (112)

src/routes.php (1 issue)

1
<?php
2
3
if( ( $conf = config( 'shop.routes.admin', ['prefix' => 'admin', 'middleware' => ['web']] ) ) !== false ) {
0 ignored issues
show
The call to config() has too many arguments starting with array('prefix' => 'admin...eware' => array('web')). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

3
if( ( $conf = /** @scrutinizer ignore-call */ config( 'shop.routes.admin', ['prefix' => 'admin', 'middleware' => ['web']] ) ) !== false ) {

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.

Loading history...
4
5
	Route::group( $conf, function() {
6
7
		Route::match( array( 'GET' ), '', array(
8
			'as' => 'aimeos_shop_admin',
9
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
10
		) )->where( ['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/{type}', array(
21
			'as' => 'aimeos_shop_jqadm_file',
22
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
23
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
24
25
		Route::match( array( 'GET' ), 'copy/{resource}/{id}', array(
26
			'as' => 'aimeos_shop_jqadm_copy',
27
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
28
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) );
29
30
		Route::match( array( 'GET' ), 'create/{resource}', array(
31
			'as' => 'aimeos_shop_jqadm_create',
32
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
33
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) );
34
35
		Route::match( array( 'POST' ), 'delete/{resource}/{id?}', array(
36
			'as' => 'aimeos_shop_jqadm_delete',
37
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
38
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) );
39
40
		Route::match( array( 'GET', 'POST' ), 'export/{resource}', array(
41
			'as' => 'aimeos_shop_jqadm_export',
42
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
43
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) );
44
45
		Route::match( array( 'GET' ), 'get/{resource}/{id}', array(
46
			'as' => 'aimeos_shop_jqadm_get',
47
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
48
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) );
49
50
		Route::match( array( 'POST' ), 'save/{resource}', array(
51
			'as' => 'aimeos_shop_jqadm_save',
52
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
53
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) );
54
55
		Route::match( array( 'GET', 'POST' ), 'search/{resource}', array(
56
			'as' => 'aimeos_shop_jqadm_search',
57
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
58
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) );
59
60
	});
61
}
62
63
64
if( ( $conf = config( 'shop.routes.jsonadm', ['prefix' => 'admin/{site}/jsonadm', 'middleware' => ['web', 'auth']] ) ) !== false ) {
65
66
	Route::group( $conf, function() {
67
68
		Route::match( array( 'DELETE' ), '{resource}/{id?}', array(
69
			'as' => 'aimeos_shop_jsonadm_delete',
70
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
71
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) );
72
73
		Route::match( array( 'GET' ), '{resource}/{id?}', array(
74
			'as' => 'aimeos_shop_jsonadm_get',
75
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
76
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) );
77
78
		Route::match( array( 'PATCH' ), '{resource}/{id?}', array(
79
			'as' => 'aimeos_shop_jsonadm_patch',
80
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
81
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) );
82
83
		Route::match( array( 'POST' ), '{resource}/{id?}', array(
84
			'as' => 'aimeos_shop_jsonadm_post',
85
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
86
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) );
87
88
		Route::match( array( 'PUT' ), '{resource}/{id?}', array(
89
			'as' => 'aimeos_shop_jsonadm_put',
90
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
91
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]+' ) );
92
93
		Route::match( array( 'OPTIONS' ), '{resource?}', array(
94
			'as' => 'aimeos_shop_jsonadm_options',
95
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
96
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] )->where( array( 'resource' => '[a-z\/]*' ) );
97
98
	});
99
}
100
101
102
if( ( $conf = config( 'shop.routes.jsonapi', ['prefix' => 'jsonapi', 'middleware' => ['web', 'api']] ) ) !== false ) {
103
104
	Route::group( $conf, function() {
105
106
		Route::match( array( 'DELETE' ), '{resource}', array(
107
			'as' => 'aimeos_shop_jsonapi_delete',
108
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
109
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
110
111
		Route::match( array( 'GET' ), '{resource}', array(
112
			'as' => 'aimeos_shop_jsonapi_get',
113
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
114
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
115
116
		Route::match( array( 'PATCH' ), '{resource}', array(
117
			'as' => 'aimeos_shop_jsonapi_patch',
118
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
119
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
120
121
		Route::match( array( 'POST' ), '{resource}', array(
122
			'as' => 'aimeos_shop_jsonapi_post',
123
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
124
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
125
126
		Route::match( array( 'PUT' ), '{resource}', array(
127
			'as' => 'aimeos_shop_jsonapi_put',
128
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
129
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
130
131
		Route::match( array( 'GET', 'OPTIONS' ), '{resource?}', array(
132
			'as' => 'aimeos_shop_jsonapi_options',
133
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
134
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
135
136
	});
137
}
138
139
140
if( ( $conf = config( 'shop.routes.update', [] ) ) !== false ) {
141
142
	Route::group( $conf, function() {
143
144
		Route::match( array( 'GET', 'POST' ), 'update', array(
145
			'as' => 'aimeos_shop_update',
146
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
147
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
148
149
	});
150
}
151
152
153
if( ( $conf = config( 'shop.routes.account', ['prefix' => 'profile', 'middleware' => ['web', 'auth']] ) ) !== false ) {
154
155
	Route::group( $conf, function() {
156
157
		Route::match( array( 'GET', 'POST' ), 'favorite/{fav_action?}/{fav_id?}/{d_name?}/{d_pos?}', array(
158
			'as' => 'aimeos_shop_account_favorite',
159
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
160
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
161
162
		Route::match( array( 'GET', 'POST' ), 'watch/{wat_action?}/{wat_id?}/{d_name?}/{d_pos?}', array(
163
			'as' => 'aimeos_shop_account_watch',
164
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
165
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
166
167
		Route::match( array( 'GET', 'POST' ), 'download/{dl_id}', array(
168
			'as' => 'aimeos_shop_account_download',
169
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
170
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
171
172
		Route::match( array( 'GET', 'POST' ), '', array(
173
			'as' => 'aimeos_shop_account',
174
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
175
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
176
177
	});
178
}
179
180
181
if( ( $conf = config( 'shop.routes.supplier', ['prefix' => 'supplier', 'middleware' => ['web']] ) ) !== false ) {
182
183
	Route::group( $conf, function() {
184
185
		Route::match( array( 'GET', 'POST' ), '{s_name}/{f_supid}', array(
186
			'as' => 'aimeos_shop_supplier',
187
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
188
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
189
190
	} );
191
}
192
193
194
if( ( $conf = config( 'shop.routes.default', ['prefix' => 'shop', 'middleware' => ['web']] ) ) !== false ) {
195
196
	Route::group( $conf, function() {
197
198
		Route::match( array( 'GET', 'POST' ), 'count', array(
199
			'as' => 'aimeos_shop_count',
200
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
201
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
202
203
		Route::match( array( 'GET', 'POST' ), 'suggest', array(
204
			'as' => 'aimeos_shop_suggest',
205
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
206
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
207
208
		Route::match( array( 'GET', 'POST' ), 'stock', array(
209
			'as' => 'aimeos_shop_stock',
210
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
211
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
212
213
		Route::match( array( 'GET', 'POST' ), 'basket', array(
214
			'as' => 'aimeos_shop_basket',
215
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
216
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
217
218
		Route::match( array( 'GET', 'POST' ), 'checkout/{c_step?}', array(
219
			'as' => 'aimeos_shop_checkout',
220
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
221
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
222
223
		Route::match( array( 'GET', 'POST' ), 'confirm/{code?}', array(
224
			'as' => 'aimeos_shop_confirm',
225
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
226
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
227
228
		Route::match( array( 'GET', 'POST' ), 'pin', array(
229
			'as' => 'aimeos_shop_session_pinned',
230
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
231
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
232
233
		Route::match( array( 'GET', 'POST' ), '{f_name}~{f_catid}', array(
234
			'as' => 'aimeos_shop_tree',
235
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
236
		) )->where( ['site' => '[A-Za-z0-9\.\-]+', 'f_name' => '[^~]*'] );
237
238
		Route::match( array( 'GET', 'POST' ), '{d_name}/{d_pos?}/{d_prodid?}', array(
239
			'as' => 'aimeos_shop_detail',
240
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
241
		) )->where( ['site' => '[A-Za-z0-9\.\-]+', 'd_pos' => '[0-9]*'] );
242
243
		Route::match( array( 'GET', 'POST' ), '', array(
244
			'as' => 'aimeos_shop_list',
245
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
246
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
247
248
	});
249
}
250
251
252
if( ( $conf = config( 'shop.routes.legal', [] ) ) !== false ) {
253
254
	Route::group( $conf, function() {
255
256
		Route::get( 'terms', array(
257
			'as' => 'aimeos_shop_terms',
258
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
259
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
260
261
		Route::get( 'privacy', array(
262
			'as' => 'aimeos_shop_privacy',
263
			'uses' => 'Aimeos\Shop\Controller\[email protected]'
264
		) )->where( ['site' => '[A-Za-z0-9\.\-]+'] );
265
	});
266
}
267