Completed
Push — master ( 06a6c1...f03436 )
by Aimeos
03:56
created
admin/jqadm/src/Admin/JQAdm/Type/Product/Property/Standard.php 2 patches
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -88,14 +88,12 @@  discard block
 block discarded – undo
88 88
 				$view->tabindex = ++$idx + 1;
89 89
 				$view->itemBody .= $client->copy();
90 90
 			}
91
-		}
92
-		catch( \Aimeos\MShop\Exception $e )
91
+		} catch( \Aimeos\MShop\Exception $e )
93 92
 		{
94 93
 			$error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
95 94
 			$view->errors = $view->get( 'errors', [] ) + $error;
96 95
 			$this->logException( $e );
97
-		}
98
-		catch( \Exception $e )
96
+		} catch( \Exception $e )
99 97
 		{
100 98
 			$error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
101 99
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -137,14 +135,12 @@  discard block
 block discarded – undo
137 135
 				$view->tabindex = ++$idx + 1;
138 136
 				$view->itemBody .= $client->create();
139 137
 			}
140
-		}
141
-		catch( \Aimeos\MShop\Exception $e )
138
+		} catch( \Aimeos\MShop\Exception $e )
142 139
 		{
143 140
 			$error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
144 141
 			$view->errors = $view->get( 'errors', [] ) + $error;
145 142
 			$this->logException( $e );
146
-		}
147
-		catch( \Exception $e )
143
+		} catch( \Exception $e )
148 144
 		{
149 145
 			$error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
150 146
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -185,14 +181,12 @@  discard block
 block discarded – undo
185 181
 
186 182
 			$this->nextAction( $view, 'search', 'type/product/property', null, 'delete' );
187 183
 			return;
188
-		}
189
-		catch( \Aimeos\MShop\Exception $e )
184
+		} catch( \Aimeos\MShop\Exception $e )
190 185
 		{
191 186
 			$error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
192 187
 			$view->errors = $view->get( 'errors', [] ) + $error;
193 188
 			$this->logException( $e );
194
-		}
195
-		catch( \Exception $e )
189
+		} catch( \Exception $e )
196 190
 		{
197 191
 			$error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
198 192
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -233,14 +227,12 @@  discard block
 block discarded – undo
233 227
 				$view->tabindex = ++$idx + 1;
234 228
 				$view->itemBody .= $client->get();
235 229
 			}
236
-		}
237
-		catch( \Aimeos\MShop\Exception $e )
230
+		} catch( \Aimeos\MShop\Exception $e )
238 231
 		{
239 232
 			$error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
240 233
 			$view->errors = $view->get( 'errors', [] ) + $error;
241 234
 			$this->logException( $e );
242
-		}
243
-		catch( \Exception $e )
235
+		} catch( \Exception $e )
244 236
 		{
245 237
 			$error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
246 238
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -277,18 +269,15 @@  discard block
 block discarded – undo
277 269
 
278 270
 			$this->nextAction( $view, $view->param( 'next' ), 'type/product/property', $view->item->getId(), 'save' );
279 271
 			return;
280
-		}
281
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
272
+		} catch( \Aimeos\Admin\JQAdm\Exception $e )
282 273
 		{
283 274
 			// fall through to create
284
-		}
285
-		catch( \Aimeos\MShop\Exception $e )
275
+		} catch( \Aimeos\MShop\Exception $e )
286 276
 		{
287 277
 			$error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
288 278
 			$view->errors = $view->get( 'errors', [] ) + $error;
289 279
 			$this->logException( $e );
290
-		}
291
-		catch( \Exception $e )
280
+		} catch( \Exception $e )
292 281
 		{
293 282
 			$error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
294 283
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -327,14 +316,12 @@  discard block
 block discarded – undo
327 316
 			foreach( $this->getSubClients() as $client ) {
328 317
 				$view->itemBody .= $client->search();
329 318
 			}
330
-		}
331
-		catch( \Aimeos\MShop\Exception $e )
319
+		} catch( \Aimeos\MShop\Exception $e )
332 320
 		{
333 321
 			$error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
334 322
 			$view->errors = $view->get( 'errors', [] ) + $error;
335 323
 			$this->logException( $e );
336
-		}
337
-		catch( \Exception $e )
324
+		} catch( \Exception $e )
338 325
 		{
339 326
 			$error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
340 327
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 namespace Aimeos\Admin\JQAdm\Type\Product\Property;
12 12
 
13
-sprintf( 'type/product/property' ); // for translation
13
+sprintf('type/product/property'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -35,37 +35,37 @@  discard block
 block discarded – undo
35 35
 
36 36
 		try
37 37
 		{
38
-			if( ( $id = $view->param( 'id' ) ) === null ) {
39
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
38
+			if (($id = $view->param('id')) === null) {
39
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
40 40
 			}
41 41
 
42
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'product/property/type' );
43
-			$view->item = $manager->getItem( $id );
42
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'product/property/type');
43
+			$view->item = $manager->getItem($id);
44 44
 
45
-			$view->itemData = $this->toArray( $view->item, true );
45
+			$view->itemData = $this->toArray($view->item, true);
46 46
 			$view->itemSubparts = $this->getSubClientNames();
47 47
 			$view->itemBody = '';
48 48
 
49
-			foreach( $this->getSubClients() as $idx => $client )
49
+			foreach ($this->getSubClients() as $idx => $client)
50 50
 			{
51 51
 				$view->tabindex = ++$idx + 1;
52 52
 				$view->itemBody .= $client->copy();
53 53
 			}
54 54
 		}
55
-		catch( \Aimeos\MShop\Exception $e )
55
+		catch (\Aimeos\MShop\Exception $e)
56 56
 		{
57
-			$error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
58
-			$view->errors = $view->get( 'errors', [] ) + $error;
59
-			$this->logException( $e );
57
+			$error = array('type-product-property-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
58
+			$view->errors = $view->get('errors', []) + $error;
59
+			$this->logException($e);
60 60
 		}
61
-		catch( \Exception $e )
61
+		catch (\Exception $e)
62 62
 		{
63
-			$error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
64
-			$view->errors = $view->get( 'errors', [] ) + $error;
65
-			$this->logException( $e );
63
+			$error = array('type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
64
+			$view->errors = $view->get('errors', []) + $error;
65
+			$this->logException($e);
66 66
 		}
67 67
 
68
-		return $this->render( $view );
68
+		return $this->render($view);
69 69
 	}
70 70
 
71 71
 
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
 
82 82
 		try
83 83
 		{
84
-			$data = $view->param( 'item', [] );
84
+			$data = $view->param('item', []);
85 85
 
86
-			if( !isset( $view->item ) ) {
87
-				$view->item = \Aimeos\MShop\Factory::createManager( $context, 'product/property/type' )->createItem();
86
+			if (!isset($view->item)) {
87
+				$view->item = \Aimeos\MShop\Factory::createManager($context, 'product/property/type')->createItem();
88 88
 			}
89 89
 
90 90
 			$data['product.property.type.siteid'] = $view->item->getSiteId();
@@ -93,26 +93,26 @@  discard block
 block discarded – undo
93 93
 			$view->itemData = $data;
94 94
 			$view->itemBody = '';
95 95
 
96
-			foreach( $this->getSubClients() as $idx => $client )
96
+			foreach ($this->getSubClients() as $idx => $client)
97 97
 			{
98 98
 				$view->tabindex = ++$idx + 1;
99 99
 				$view->itemBody .= $client->create();
100 100
 			}
101 101
 		}
102
-		catch( \Aimeos\MShop\Exception $e )
102
+		catch (\Aimeos\MShop\Exception $e)
103 103
 		{
104
-			$error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
105
-			$view->errors = $view->get( 'errors', [] ) + $error;
106
-			$this->logException( $e );
104
+			$error = array('type-product-property-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
105
+			$view->errors = $view->get('errors', []) + $error;
106
+			$this->logException($e);
107 107
 		}
108
-		catch( \Exception $e )
108
+		catch (\Exception $e)
109 109
 		{
110
-			$error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
111
-			$view->errors = $view->get( 'errors', [] ) + $error;
112
-			$this->logException( $e );
110
+			$error = array('type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
111
+			$view->errors = $view->get('errors', []) + $error;
112
+			$this->logException($e);
113 113
 		}
114 114
 
115
-		return $this->render( $view );
115
+		return $this->render($view);
116 116
 	}
117 117
 
118 118
 
@@ -126,38 +126,38 @@  discard block
 block discarded – undo
126 126
 		$view = $this->getView();
127 127
 		$context = $this->getContext();
128 128
 
129
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'product/property/type' );
129
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'product/property/type');
130 130
 		$manager->begin();
131 131
 
132 132
 		try
133 133
 		{
134
-			if( ( $id = $view->param( 'id' ) ) === null ) {
135
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
134
+			if (($id = $view->param('id')) === null) {
135
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
136 136
 			}
137 137
 
138
-			$view->item = $manager->getItem( $id );
138
+			$view->item = $manager->getItem($id);
139 139
 
140
-			foreach( $this->getSubClients() as $client ) {
140
+			foreach ($this->getSubClients() as $client) {
141 141
 				$client->delete();
142 142
 			}
143 143
 
144
-			$manager->deleteItem( $id );
144
+			$manager->deleteItem($id);
145 145
 			$manager->commit();
146 146
 
147
-			$this->nextAction( $view, 'search', 'type/product/property', null, 'delete' );
147
+			$this->nextAction($view, 'search', 'type/product/property', null, 'delete');
148 148
 			return;
149 149
 		}
150
-		catch( \Aimeos\MShop\Exception $e )
150
+		catch (\Aimeos\MShop\Exception $e)
151 151
 		{
152
-			$error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
153
-			$view->errors = $view->get( 'errors', [] ) + $error;
154
-			$this->logException( $e );
152
+			$error = array('type-product-property-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
153
+			$view->errors = $view->get('errors', []) + $error;
154
+			$this->logException($e);
155 155
 		}
156
-		catch( \Exception $e )
156
+		catch (\Exception $e)
157 157
 		{
158
-			$error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
159
-			$view->errors = $view->get( 'errors', [] ) + $error;
160
-			$this->logException( $e );
158
+			$error = array('type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
159
+			$view->errors = $view->get('errors', []) + $error;
160
+			$this->logException($e);
161 161
 		}
162 162
 
163 163
 		$manager->rollback();
@@ -178,37 +178,37 @@  discard block
 block discarded – undo
178 178
 
179 179
 		try
180 180
 		{
181
-			if( ( $id = $view->param( 'id' ) ) === null ) {
182
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
181
+			if (($id = $view->param('id')) === null) {
182
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
183 183
 			}
184 184
 
185
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'product/property/type' );
185
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'product/property/type');
186 186
 
187
-			$view->item = $manager->getItem( $id );
187
+			$view->item = $manager->getItem($id);
188 188
 			$view->itemSubparts = $this->getSubClientNames();
189
-			$view->itemData = $this->toArray( $view->item );
189
+			$view->itemData = $this->toArray($view->item);
190 190
 			$view->itemBody = '';
191 191
 
192
-			foreach( $this->getSubClients() as $idx => $client )
192
+			foreach ($this->getSubClients() as $idx => $client)
193 193
 			{
194 194
 				$view->tabindex = ++$idx + 1;
195 195
 				$view->itemBody .= $client->get();
196 196
 			}
197 197
 		}
198
-		catch( \Aimeos\MShop\Exception $e )
198
+		catch (\Aimeos\MShop\Exception $e)
199 199
 		{
200
-			$error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
201
-			$view->errors = $view->get( 'errors', [] ) + $error;
202
-			$this->logException( $e );
200
+			$error = array('type-product-property-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
201
+			$view->errors = $view->get('errors', []) + $error;
202
+			$this->logException($e);
203 203
 		}
204
-		catch( \Exception $e )
204
+		catch (\Exception $e)
205 205
 		{
206
-			$error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
207
-			$view->errors = $view->get( 'errors', [] ) + $error;
208
-			$this->logException( $e );
206
+			$error = array('type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
207
+			$view->errors = $view->get('errors', []) + $error;
208
+			$this->logException($e);
209 209
 		}
210 210
 
211
-		return $this->render( $view );
211
+		return $this->render($view);
212 212
 	}
213 213
 
214 214
 
@@ -222,40 +222,40 @@  discard block
 block discarded – undo
222 222
 		$view = $this->getView();
223 223
 		$context = $this->getContext();
224 224
 
225
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'product/property/type' );
225
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'product/property/type');
226 226
 		$manager->begin();
227 227
 
228 228
 		try
229 229
 		{
230
-			$item = $this->fromArray( $view->param( 'item', [] ) );
231
-			$view->item = $item->getId() ? $item : $manager->saveItem( $item );
230
+			$item = $this->fromArray($view->param('item', []));
231
+			$view->item = $item->getId() ? $item : $manager->saveItem($item);
232 232
 			$view->itemBody = '';
233 233
 
234
-			foreach( $this->getSubClients() as $client ) {
234
+			foreach ($this->getSubClients() as $client) {
235 235
 				$view->itemBody .= $client->save();
236 236
 			}
237 237
 
238
-			$manager->saveItem( clone $view->item );
238
+			$manager->saveItem(clone $view->item);
239 239
 			$manager->commit();
240 240
 
241
-			$this->nextAction( $view, $view->param( 'next' ), 'type/product/property', $view->item->getId(), 'save' );
241
+			$this->nextAction($view, $view->param('next'), 'type/product/property', $view->item->getId(), 'save');
242 242
 			return;
243 243
 		}
244
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
244
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
245 245
 		{
246 246
 			// fall through to create
247 247
 		}
248
-		catch( \Aimeos\MShop\Exception $e )
248
+		catch (\Aimeos\MShop\Exception $e)
249 249
 		{
250
-			$error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
251
-			$view->errors = $view->get( 'errors', [] ) + $error;
252
-			$this->logException( $e );
250
+			$error = array('type-product-property-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
251
+			$view->errors = $view->get('errors', []) + $error;
252
+			$this->logException($e);
253 253
 		}
254
-		catch( \Exception $e )
254
+		catch (\Exception $e)
255 255
 		{
256
-			$error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
257
-			$view->errors = $view->get( 'errors', [] ) + $error;
258
-			$this->logException( $e );
256
+			$error = array('type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
257
+			$view->errors = $view->get('errors', []) + $error;
258
+			$this->logException($e);
259 259
 		}
260 260
 
261 261
 		$manager->rollback();
@@ -277,31 +277,31 @@  discard block
 block discarded – undo
277 277
 		try
278 278
 		{
279 279
 			$total = 0;
280
-			$params = $this->storeSearchParams( $view->param(), 'type/product/property' );
281
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'product/property/type' );
282
-			$search = $this->initCriteria( $manager->createSearch(), $params );
280
+			$params = $this->storeSearchParams($view->param(), 'type/product/property');
281
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'product/property/type');
282
+			$search = $this->initCriteria($manager->createSearch(), $params);
283 283
 
284
-			$view->items = $manager->searchItems( $search, [], $total );
285
-			$view->filterAttributes = $manager->getSearchAttributes( true );
284
+			$view->items = $manager->searchItems($search, [], $total);
285
+			$view->filterAttributes = $manager->getSearchAttributes(true);
286 286
 			$view->filterOperators = $search->getOperators();
287 287
 			$view->total = $total;
288 288
 			$view->itemBody = '';
289 289
 
290
-			foreach( $this->getSubClients() as $client ) {
290
+			foreach ($this->getSubClients() as $client) {
291 291
 				$view->itemBody .= $client->search();
292 292
 			}
293 293
 		}
294
-		catch( \Aimeos\MShop\Exception $e )
294
+		catch (\Aimeos\MShop\Exception $e)
295 295
 		{
296
-			$error = array( 'type-product-property-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
297
-			$view->errors = $view->get( 'errors', [] ) + $error;
298
-			$this->logException( $e );
296
+			$error = array('type-product-property-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
297
+			$view->errors = $view->get('errors', []) + $error;
298
+			$this->logException($e);
299 299
 		}
300
-		catch( \Exception $e )
300
+		catch (\Exception $e)
301 301
 		{
302
-			$error = array( 'type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
303
-			$view->errors = $view->get( 'errors', [] ) + $error;
304
-			$this->logException( $e );
302
+			$error = array('type-product-property-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
303
+			$view->errors = $view->get('errors', []) + $error;
304
+			$this->logException($e);
305 305
 		}
306 306
 
307 307
 		/** admin/jqadm/type/product/property/template-list
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 		$tplconf = 'admin/jqadm/type/product/property/template-list';
327 327
 		$default = 'type/product/property/list-standard.php';
328 328
 
329
-		return $view->render( $view->config( $tplconf, $default ) );
329
+		return $view->render($view->config($tplconf, $default));
330 330
 	}
331 331
 
332 332
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 	 * @param string|null $name Name of the sub-client (Default if null)
338 338
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
339 339
 	 */
340
-	public function getSubClient( $liststype, $name = null )
340
+	public function getSubClient($liststype, $name = null)
341 341
 	{
342 342
 		/** admin/jqadm/type/product/property/decorators/excludes
343 343
 		 * Excludes decorators added by the "common" option from the list type JQAdm client
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 		 * @see admin/jqadm/type/product/property/decorators/excludes
413 413
 		 * @see admin/jqadm/type/product/property/decorators/global
414 414
 		 */
415
-		return $this->createSubClient( 'type/product/property' . $liststype, $name );
415
+		return $this->createSubClient('type/product/property' . $liststype, $name);
416 416
 	}
417 417
 
418 418
 
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 		 * @since 2017.10
457 457
 		 * @category Developer
458 458
 		 */
459
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/type/product/property/standard/subparts', [] );
459
+		return $this->getContext()->getConfig()->get('admin/jqadm/type/product/property/standard/subparts', []);
460 460
 	}
461 461
 
462 462
 
@@ -467,17 +467,17 @@  discard block
 block discarded – undo
467 467
 	 * @param string[] Data array
468 468
 	 * @return \Aimeos\MShop\Common\Item\Type\Iface New list type item object
469 469
 	 */
470
-	protected function fromArray( array $data )
470
+	protected function fromArray(array $data)
471 471
 	{
472
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product/property/type' );
472
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product/property/type');
473 473
 
474
-		if( isset( $data['product.property.type.id'] ) && $data['product.property.type.id'] != '' ) {
475
-			$item = $manager->getItem( $data['product.property.type.id'] );
474
+		if (isset($data['product.property.type.id']) && $data['product.property.type.id'] != '') {
475
+			$item = $manager->getItem($data['product.property.type.id']);
476 476
 		} else {
477 477
 			$item = $manager->createItem();
478 478
 		}
479 479
 
480
-		$item->fromArray( $data );
480
+		$item->fromArray($data);
481 481
 
482 482
 		return $item;
483 483
 	}
@@ -489,11 +489,11 @@  discard block
 block discarded – undo
489 489
 	 * @param \Aimeos\MShop\Common\Item\Type\Iface $item Type item object
490 490
 	 * @return string[] Multi-dimensional associative list of item data
491 491
 	 */
492
-	protected function toArray( \Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false )
492
+	protected function toArray(\Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false)
493 493
 	{
494
-		$data = $item->toArray( true );
494
+		$data = $item->toArray(true);
495 495
 
496
-		if( $copy === true )
496
+		if ($copy === true)
497 497
 		{
498 498
 			$data['product.property.type.code'] = $data['product.property.type.code'] . '_copy';
499 499
 			$data['product.property.type.id'] = '';
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
510 510
 	 * @return string HTML output
511 511
 	 */
512
-	protected function render( \Aimeos\MW\View\Iface $view )
512
+	protected function render(\Aimeos\MW\View\Iface $view)
513 513
 	{
514 514
 		/** admin/jqadm/type/product/property/template-item
515 515
 		 * Relative path to the HTML body template for the list type item.
@@ -533,6 +533,6 @@  discard block
 block discarded – undo
533 533
 		$tplconf = 'admin/jqadm/type/product/property/template-item';
534 534
 		$default = 'type/product/property/item-standard.php';
535 535
 
536
-		return $view->render( $view->config( $tplconf, $default ) );
536
+		return $view->render($view->config($tplconf, $default));
537 537
 	}
538 538
 }
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Type/Product/Standard.php 2 patches
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -88,14 +88,12 @@  discard block
 block discarded – undo
88 88
 				$view->tabindex = ++$idx + 1;
89 89
 				$view->itemBody .= $client->copy();
90 90
 			}
91
-		}
92
-		catch( \Aimeos\MShop\Exception $e )
91
+		} catch( \Aimeos\MShop\Exception $e )
93 92
 		{
94 93
 			$error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
95 94
 			$view->errors = $view->get( 'errors', [] ) + $error;
96 95
 			$this->logException( $e );
97
-		}
98
-		catch( \Exception $e )
96
+		} catch( \Exception $e )
99 97
 		{
100 98
 			$error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
101 99
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -137,14 +135,12 @@  discard block
 block discarded – undo
137 135
 				$view->tabindex = ++$idx + 1;
138 136
 				$view->itemBody .= $client->create();
139 137
 			}
140
-		}
141
-		catch( \Aimeos\MShop\Exception $e )
138
+		} catch( \Aimeos\MShop\Exception $e )
142 139
 		{
143 140
 			$error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
144 141
 			$view->errors = $view->get( 'errors', [] ) + $error;
145 142
 			$this->logException( $e );
146
-		}
147
-		catch( \Exception $e )
143
+		} catch( \Exception $e )
148 144
 		{
149 145
 			$error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
150 146
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -185,14 +181,12 @@  discard block
 block discarded – undo
185 181
 
186 182
 			$this->nextAction( $view, 'search', 'type/product', null, 'delete' );
187 183
 			return;
188
-		}
189
-		catch( \Aimeos\MShop\Exception $e )
184
+		} catch( \Aimeos\MShop\Exception $e )
190 185
 		{
191 186
 			$error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
192 187
 			$view->errors = $view->get( 'errors', [] ) + $error;
193 188
 			$this->logException( $e );
194
-		}
195
-		catch( \Exception $e )
189
+		} catch( \Exception $e )
196 190
 		{
197 191
 			$error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
198 192
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -233,14 +227,12 @@  discard block
 block discarded – undo
233 227
 				$view->tabindex = ++$idx + 1;
234 228
 				$view->itemBody .= $client->get();
235 229
 			}
236
-		}
237
-		catch( \Aimeos\MShop\Exception $e )
230
+		} catch( \Aimeos\MShop\Exception $e )
238 231
 		{
239 232
 			$error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
240 233
 			$view->errors = $view->get( 'errors', [] ) + $error;
241 234
 			$this->logException( $e );
242
-		}
243
-		catch( \Exception $e )
235
+		} catch( \Exception $e )
244 236
 		{
245 237
 			$error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
246 238
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -277,18 +269,15 @@  discard block
 block discarded – undo
277 269
 
278 270
 			$this->nextAction( $view, $view->param( 'next' ), 'type/product', $view->item->getId(), 'save' );
279 271
 			return;
280
-		}
281
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
272
+		} catch( \Aimeos\Admin\JQAdm\Exception $e )
282 273
 		{
283 274
 			// fall through to create
284
-		}
285
-		catch( \Aimeos\MShop\Exception $e )
275
+		} catch( \Aimeos\MShop\Exception $e )
286 276
 		{
287 277
 			$error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
288 278
 			$view->errors = $view->get( 'errors', [] ) + $error;
289 279
 			$this->logException( $e );
290
-		}
291
-		catch( \Exception $e )
280
+		} catch( \Exception $e )
292 281
 		{
293 282
 			$error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
294 283
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -327,14 +316,12 @@  discard block
 block discarded – undo
327 316
 			foreach( $this->getSubClients() as $client ) {
328 317
 				$view->itemBody .= $client->search();
329 318
 			}
330
-		}
331
-		catch( \Aimeos\MShop\Exception $e )
319
+		} catch( \Aimeos\MShop\Exception $e )
332 320
 		{
333 321
 			$error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
334 322
 			$view->errors = $view->get( 'errors', [] ) + $error;
335 323
 			$this->logException( $e );
336
-		}
337
-		catch( \Exception $e )
324
+		} catch( \Exception $e )
338 325
 		{
339 326
 			$error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
340 327
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 namespace Aimeos\Admin\JQAdm\Type\Product;
12 12
 
13
-sprintf( 'type/product' ); // for translation
13
+sprintf('type/product'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -35,37 +35,37 @@  discard block
 block discarded – undo
35 35
 
36 36
 		try
37 37
 		{
38
-			if( ( $id = $view->param( 'id' ) ) === null ) {
39
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
38
+			if (($id = $view->param('id')) === null) {
39
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
40 40
 			}
41 41
 
42
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'product/type' );
43
-			$view->item = $manager->getItem( $id );
42
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'product/type');
43
+			$view->item = $manager->getItem($id);
44 44
 
45
-			$view->itemData = $this->toArray( $view->item, true );
45
+			$view->itemData = $this->toArray($view->item, true);
46 46
 			$view->itemSubparts = $this->getSubClientNames();
47 47
 			$view->itemBody = '';
48 48
 
49
-			foreach( $this->getSubClients() as $idx => $client )
49
+			foreach ($this->getSubClients() as $idx => $client)
50 50
 			{
51 51
 				$view->tabindex = ++$idx + 1;
52 52
 				$view->itemBody .= $client->copy();
53 53
 			}
54 54
 		}
55
-		catch( \Aimeos\MShop\Exception $e )
55
+		catch (\Aimeos\MShop\Exception $e)
56 56
 		{
57
-			$error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
58
-			$view->errors = $view->get( 'errors', [] ) + $error;
59
-			$this->logException( $e );
57
+			$error = array('type-product-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
58
+			$view->errors = $view->get('errors', []) + $error;
59
+			$this->logException($e);
60 60
 		}
61
-		catch( \Exception $e )
61
+		catch (\Exception $e)
62 62
 		{
63
-			$error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
64
-			$view->errors = $view->get( 'errors', [] ) + $error;
65
-			$this->logException( $e );
63
+			$error = array('type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
64
+			$view->errors = $view->get('errors', []) + $error;
65
+			$this->logException($e);
66 66
 		}
67 67
 
68
-		return $this->render( $view );
68
+		return $this->render($view);
69 69
 	}
70 70
 
71 71
 
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
 
82 82
 		try
83 83
 		{
84
-			$data = $view->param( 'item', [] );
84
+			$data = $view->param('item', []);
85 85
 
86
-			if( !isset( $view->item ) ) {
87
-				$view->item = \Aimeos\MShop\Factory::createManager( $context, 'product/type' )->createItem();
86
+			if (!isset($view->item)) {
87
+				$view->item = \Aimeos\MShop\Factory::createManager($context, 'product/type')->createItem();
88 88
 			}
89 89
 
90 90
 			$data['product.type.siteid'] = $view->item->getSiteId();
@@ -93,26 +93,26 @@  discard block
 block discarded – undo
93 93
 			$view->itemData = $data;
94 94
 			$view->itemBody = '';
95 95
 
96
-			foreach( $this->getSubClients() as $idx => $client )
96
+			foreach ($this->getSubClients() as $idx => $client)
97 97
 			{
98 98
 				$view->tabindex = ++$idx + 1;
99 99
 				$view->itemBody .= $client->create();
100 100
 			}
101 101
 		}
102
-		catch( \Aimeos\MShop\Exception $e )
102
+		catch (\Aimeos\MShop\Exception $e)
103 103
 		{
104
-			$error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
105
-			$view->errors = $view->get( 'errors', [] ) + $error;
106
-			$this->logException( $e );
104
+			$error = array('type-product-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
105
+			$view->errors = $view->get('errors', []) + $error;
106
+			$this->logException($e);
107 107
 		}
108
-		catch( \Exception $e )
108
+		catch (\Exception $e)
109 109
 		{
110
-			$error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
111
-			$view->errors = $view->get( 'errors', [] ) + $error;
112
-			$this->logException( $e );
110
+			$error = array('type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
111
+			$view->errors = $view->get('errors', []) + $error;
112
+			$this->logException($e);
113 113
 		}
114 114
 
115
-		return $this->render( $view );
115
+		return $this->render($view);
116 116
 	}
117 117
 
118 118
 
@@ -126,38 +126,38 @@  discard block
 block discarded – undo
126 126
 		$view = $this->getView();
127 127
 		$context = $this->getContext();
128 128
 
129
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'product/type' );
129
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'product/type');
130 130
 		$manager->begin();
131 131
 
132 132
 		try
133 133
 		{
134
-			if( ( $id = $view->param( 'id' ) ) === null ) {
135
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
134
+			if (($id = $view->param('id')) === null) {
135
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
136 136
 			}
137 137
 
138
-			$view->item = $manager->getItem( $id );
138
+			$view->item = $manager->getItem($id);
139 139
 
140
-			foreach( $this->getSubClients() as $client ) {
140
+			foreach ($this->getSubClients() as $client) {
141 141
 				$client->delete();
142 142
 			}
143 143
 
144
-			$manager->deleteItem( $id );
144
+			$manager->deleteItem($id);
145 145
 			$manager->commit();
146 146
 
147
-			$this->nextAction( $view, 'search', 'type/product', null, 'delete' );
147
+			$this->nextAction($view, 'search', 'type/product', null, 'delete');
148 148
 			return;
149 149
 		}
150
-		catch( \Aimeos\MShop\Exception $e )
150
+		catch (\Aimeos\MShop\Exception $e)
151 151
 		{
152
-			$error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
153
-			$view->errors = $view->get( 'errors', [] ) + $error;
154
-			$this->logException( $e );
152
+			$error = array('type-product-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
153
+			$view->errors = $view->get('errors', []) + $error;
154
+			$this->logException($e);
155 155
 		}
156
-		catch( \Exception $e )
156
+		catch (\Exception $e)
157 157
 		{
158
-			$error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
159
-			$view->errors = $view->get( 'errors', [] ) + $error;
160
-			$this->logException( $e );
158
+			$error = array('type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
159
+			$view->errors = $view->get('errors', []) + $error;
160
+			$this->logException($e);
161 161
 		}
162 162
 
163 163
 		$manager->rollback();
@@ -178,37 +178,37 @@  discard block
 block discarded – undo
178 178
 
179 179
 		try
180 180
 		{
181
-			if( ( $id = $view->param( 'id' ) ) === null ) {
182
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
181
+			if (($id = $view->param('id')) === null) {
182
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
183 183
 			}
184 184
 
185
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'product/type' );
185
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'product/type');
186 186
 
187
-			$view->item = $manager->getItem( $id );
187
+			$view->item = $manager->getItem($id);
188 188
 			$view->itemSubparts = $this->getSubClientNames();
189
-			$view->itemData = $this->toArray( $view->item );
189
+			$view->itemData = $this->toArray($view->item);
190 190
 			$view->itemBody = '';
191 191
 
192
-			foreach( $this->getSubClients() as $idx => $client )
192
+			foreach ($this->getSubClients() as $idx => $client)
193 193
 			{
194 194
 				$view->tabindex = ++$idx + 1;
195 195
 				$view->itemBody .= $client->get();
196 196
 			}
197 197
 		}
198
-		catch( \Aimeos\MShop\Exception $e )
198
+		catch (\Aimeos\MShop\Exception $e)
199 199
 		{
200
-			$error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
201
-			$view->errors = $view->get( 'errors', [] ) + $error;
202
-			$this->logException( $e );
200
+			$error = array('type-product-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
201
+			$view->errors = $view->get('errors', []) + $error;
202
+			$this->logException($e);
203 203
 		}
204
-		catch( \Exception $e )
204
+		catch (\Exception $e)
205 205
 		{
206
-			$error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
207
-			$view->errors = $view->get( 'errors', [] ) + $error;
208
-			$this->logException( $e );
206
+			$error = array('type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
207
+			$view->errors = $view->get('errors', []) + $error;
208
+			$this->logException($e);
209 209
 		}
210 210
 
211
-		return $this->render( $view );
211
+		return $this->render($view);
212 212
 	}
213 213
 
214 214
 
@@ -222,40 +222,40 @@  discard block
 block discarded – undo
222 222
 		$view = $this->getView();
223 223
 		$context = $this->getContext();
224 224
 
225
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'product/type' );
225
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'product/type');
226 226
 		$manager->begin();
227 227
 
228 228
 		try
229 229
 		{
230
-			$item = $this->fromArray( $view->param( 'item', [] ) );
231
-			$view->item = $item->getId() ? $item : $manager->saveItem( $item );
230
+			$item = $this->fromArray($view->param('item', []));
231
+			$view->item = $item->getId() ? $item : $manager->saveItem($item);
232 232
 			$view->itemBody = '';
233 233
 
234
-			foreach( $this->getSubClients() as $client ) {
234
+			foreach ($this->getSubClients() as $client) {
235 235
 				$view->itemBody .= $client->save();
236 236
 			}
237 237
 
238
-			$manager->saveItem( clone $view->item );
238
+			$manager->saveItem(clone $view->item);
239 239
 			$manager->commit();
240 240
 
241
-			$this->nextAction( $view, $view->param( 'next' ), 'type/product', $view->item->getId(), 'save' );
241
+			$this->nextAction($view, $view->param('next'), 'type/product', $view->item->getId(), 'save');
242 242
 			return;
243 243
 		}
244
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
244
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
245 245
 		{
246 246
 			// fall through to create
247 247
 		}
248
-		catch( \Aimeos\MShop\Exception $e )
248
+		catch (\Aimeos\MShop\Exception $e)
249 249
 		{
250
-			$error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
251
-			$view->errors = $view->get( 'errors', [] ) + $error;
252
-			$this->logException( $e );
250
+			$error = array('type-product-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
251
+			$view->errors = $view->get('errors', []) + $error;
252
+			$this->logException($e);
253 253
 		}
254
-		catch( \Exception $e )
254
+		catch (\Exception $e)
255 255
 		{
256
-			$error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
257
-			$view->errors = $view->get( 'errors', [] ) + $error;
258
-			$this->logException( $e );
256
+			$error = array('type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
257
+			$view->errors = $view->get('errors', []) + $error;
258
+			$this->logException($e);
259 259
 		}
260 260
 
261 261
 		$manager->rollback();
@@ -277,31 +277,31 @@  discard block
 block discarded – undo
277 277
 		try
278 278
 		{
279 279
 			$total = 0;
280
-			$params = $this->storeSearchParams( $view->param(), 'type/product' );
281
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'product/type' );
282
-			$search = $this->initCriteria( $manager->createSearch(), $params );
280
+			$params = $this->storeSearchParams($view->param(), 'type/product');
281
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'product/type');
282
+			$search = $this->initCriteria($manager->createSearch(), $params);
283 283
 
284
-			$view->items = $manager->searchItems( $search, [], $total );
285
-			$view->filterAttributes = $manager->getSearchAttributes( true );
284
+			$view->items = $manager->searchItems($search, [], $total);
285
+			$view->filterAttributes = $manager->getSearchAttributes(true);
286 286
 			$view->filterOperators = $search->getOperators();
287 287
 			$view->total = $total;
288 288
 			$view->itemBody = '';
289 289
 
290
-			foreach( $this->getSubClients() as $client ) {
290
+			foreach ($this->getSubClients() as $client) {
291 291
 				$view->itemBody .= $client->search();
292 292
 			}
293 293
 		}
294
-		catch( \Aimeos\MShop\Exception $e )
294
+		catch (\Aimeos\MShop\Exception $e)
295 295
 		{
296
-			$error = array( 'type-product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
297
-			$view->errors = $view->get( 'errors', [] ) + $error;
298
-			$this->logException( $e );
296
+			$error = array('type-product-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
297
+			$view->errors = $view->get('errors', []) + $error;
298
+			$this->logException($e);
299 299
 		}
300
-		catch( \Exception $e )
300
+		catch (\Exception $e)
301 301
 		{
302
-			$error = array( 'type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
303
-			$view->errors = $view->get( 'errors', [] ) + $error;
304
-			$this->logException( $e );
302
+			$error = array('type-product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
303
+			$view->errors = $view->get('errors', []) + $error;
304
+			$this->logException($e);
305 305
 		}
306 306
 
307 307
 		/** admin/jqadm/type/product/template-list
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 		$tplconf = 'admin/jqadm/type/product/template-list';
327 327
 		$default = 'type/product/list-standard.php';
328 328
 
329
-		return $view->render( $view->config( $tplconf, $default ) );
329
+		return $view->render($view->config($tplconf, $default));
330 330
 	}
331 331
 
332 332
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 	 * @param string|null $name Name of the sub-client (Default if null)
338 338
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
339 339
 	 */
340
-	public function getSubClient( $type, $name = null )
340
+	public function getSubClient($type, $name = null)
341 341
 	{
342 342
 		/** admin/jqadm/type/product/decorators/excludes
343 343
 		 * Excludes decorators added by the "common" option from the type JQAdm client
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 		 * @see admin/jqadm/type/product/decorators/excludes
413 413
 		 * @see admin/jqadm/type/product/decorators/global
414 414
 		 */
415
-		return $this->createSubClient( 'type/product' . $type, $name );
415
+		return $this->createSubClient('type/product' . $type, $name);
416 416
 	}
417 417
 
418 418
 
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 		 * @since 2017.10
457 457
 		 * @category Developer
458 458
 		 */
459
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/type/product/standard/subparts', [] );
459
+		return $this->getContext()->getConfig()->get('admin/jqadm/type/product/standard/subparts', []);
460 460
 	}
461 461
 
462 462
 
@@ -467,17 +467,17 @@  discard block
 block discarded – undo
467 467
 	 * @param string[] Data array
468 468
 	 * @return \Aimeos\MShop\Common\Item\Type\Iface New type item object
469 469
 	 */
470
-	protected function fromArray( array $data )
470
+	protected function fromArray(array $data)
471 471
 	{
472
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product/type' );
472
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product/type');
473 473
 
474
-		if( isset( $data['product.type.id'] ) && $data['product.type.id'] != '' ) {
475
-			$item = $manager->getItem( $data['product.type.id'] );
474
+		if (isset($data['product.type.id']) && $data['product.type.id'] != '') {
475
+			$item = $manager->getItem($data['product.type.id']);
476 476
 		} else {
477 477
 			$item = $manager->createItem();
478 478
 		}
479 479
 
480
-		$item->fromArray( $data );
480
+		$item->fromArray($data);
481 481
 
482 482
 		return $item;
483 483
 	}
@@ -489,11 +489,11 @@  discard block
 block discarded – undo
489 489
 	 * @param \Aimeos\MShop\Common\Item\Type\Iface $item Type item object
490 490
 	 * @return string[] Multi-dimensional associative list of item data
491 491
 	 */
492
-	protected function toArray( \Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false )
492
+	protected function toArray(\Aimeos\MShop\Common\Item\Type\Iface $item, $copy = false)
493 493
 	{
494
-		$data = $item->toArray( true );
494
+		$data = $item->toArray(true);
495 495
 
496
-		if( $copy === true )
496
+		if ($copy === true)
497 497
 		{
498 498
 			$data['product.type.code'] = $data['product.type.code'] . '_copy';
499 499
 			$data['product.type.id'] = '';
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
510 510
 	 * @return string HTML output
511 511
 	 */
512
-	protected function render( \Aimeos\MW\View\Iface $view )
512
+	protected function render(\Aimeos\MW\View\Iface $view)
513 513
 	{
514 514
 		/** admin/jqadm/type/product/template-item
515 515
 		 * Relative path to the HTML body template for the type item.
@@ -533,6 +533,6 @@  discard block
 block discarded – undo
533 533
 		$tplconf = 'admin/jqadm/type/product/template-item';
534 534
 		$default = 'type/product/item-standard.php';
535 535
 
536
-		return $view->render( $view->config( $tplconf, $default ) );
536
+		return $view->render($view->config($tplconf, $default));
537 537
 	}
538 538
 }
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Product/Standard.php 2 patches
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -235,14 +235,12 @@  discard block
 block discarded – undo
235 235
 				$view->tabindex = ++$idx + 1;
236 236
 				$view->itemBody .= $client->copy();
237 237
 			}
238
-		}
239
-		catch( \Aimeos\MShop\Exception $e )
238
+		} catch( \Aimeos\MShop\Exception $e )
240 239
 		{
241 240
 			$error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
242 241
 			$view->errors = $view->get( 'errors', [] ) + $error;
243 242
 			$this->logException( $e );
244
-		}
245
-		catch( \Exception $e )
243
+		} catch( \Exception $e )
246 244
 		{
247 245
 			$error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
248 246
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -285,14 +283,12 @@  discard block
 block discarded – undo
285 283
 				$view->tabindex = ++$idx + 1;
286 284
 				$view->itemBody .= $client->create();
287 285
 			}
288
-		}
289
-		catch( \Aimeos\MShop\Exception $e )
286
+		} catch( \Aimeos\MShop\Exception $e )
290 287
 		{
291 288
 			$error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
292 289
 			$view->errors = $view->get( 'errors', [] ) + $error;
293 290
 			$this->logException( $e );
294
-		}
295
-		catch( \Exception $e )
291
+		} catch( \Exception $e )
296 292
 		{
297 293
 			$error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
298 294
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -333,14 +329,12 @@  discard block
 block discarded – undo
333 329
 
334 330
 			$this->nextAction( $view, 'search', 'product', null, 'delete' );
335 331
 			return;
336
-		}
337
-		catch( \Aimeos\MShop\Exception $e )
332
+		} catch( \Aimeos\MShop\Exception $e )
338 333
 		{
339 334
 			$error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
340 335
 			$view->errors = $view->get( 'errors', [] ) + $error;
341 336
 			$this->logException( $e );
342
-		}
343
-		catch( \Exception $e )
337
+		} catch( \Exception $e )
344 338
 		{
345 339
 			$error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
346 340
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -382,14 +376,12 @@  discard block
 block discarded – undo
382 376
 				$view->tabindex = ++$idx + 1;
383 377
 				$view->itemBody .= $client->get();
384 378
 			}
385
-		}
386
-		catch( \Aimeos\MShop\Exception $e )
379
+		} catch( \Aimeos\MShop\Exception $e )
387 380
 		{
388 381
 			$error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
389 382
 			$view->errors = $view->get( 'errors', [] ) + $error;
390 383
 			$this->logException( $e );
391
-		}
392
-		catch( \Exception $e )
384
+		} catch( \Exception $e )
393 385
 		{
394 386
 			$error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
395 387
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -426,18 +418,15 @@  discard block
 block discarded – undo
426 418
 
427 419
 			$this->nextAction( $view, $view->param( 'next' ), 'product', $view->item->getId(), 'save' );
428 420
 			return;
429
-		}
430
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
421
+		} catch( \Aimeos\Admin\JQAdm\Exception $e )
431 422
 		{
432 423
 			// fall through to create
433
-		}
434
-		catch( \Aimeos\MShop\Exception $e )
424
+		} catch( \Aimeos\MShop\Exception $e )
435 425
 		{
436 426
 			$error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
437 427
 			$view->errors = $view->get( 'errors', [] ) + $error;
438 428
 			$this->logException( $e );
439
-		}
440
-		catch( \Exception $e )
429
+		} catch( \Exception $e )
441 430
 		{
442 431
 			$error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
443 432
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -477,14 +466,12 @@  discard block
 block discarded – undo
477 466
 			foreach( $this->getSubClients() as $client ) {
478 467
 				$view->itemBody .= $client->search();
479 468
 			}
480
-		}
481
-		catch( \Aimeos\MShop\Exception $e )
469
+		} catch( \Aimeos\MShop\Exception $e )
482 470
 		{
483 471
 			$error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
484 472
 			$view->errors = $view->get( 'errors', [] ) + $error;
485 473
 			$this->logException( $e );
486
-		}
487
-		catch( \Exception $e )
474
+		} catch( \Exception $e )
488 475
 		{
489 476
 			$error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
490 477
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +116 added lines, -116 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 namespace Aimeos\Admin\JQAdm\Product;
12 12
 
13
-sprintf( 'product' ); // for translation
13
+sprintf('product'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -35,38 +35,38 @@  discard block
 block discarded – undo
35 35
 
36 36
 		try
37 37
 		{
38
-			if( ( $id = $view->param( 'id' ) ) === null ) {
39
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
38
+			if (($id = $view->param('id')) === null) {
39
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
40 40
 			}
41 41
 
42
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'product' );
43
-			$view->item = $manager->getItem( $id, $this->getDomains() );
42
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'product');
43
+			$view->item = $manager->getItem($id, $this->getDomains());
44 44
 
45
-			$view->itemData = $this->toArray( $view->item, true );
45
+			$view->itemData = $this->toArray($view->item, true);
46 46
 			$view->itemSubparts = $this->getSubClientNames();
47 47
 			$view->itemTypes = $this->getTypeItems();
48 48
 			$view->itemBody = '';
49 49
 
50
-			foreach( $this->getSubClients() as $idx => $client )
50
+			foreach ($this->getSubClients() as $idx => $client)
51 51
 			{
52 52
 				$view->tabindex = ++$idx + 1;
53 53
 				$view->itemBody .= $client->copy();
54 54
 			}
55 55
 		}
56
-		catch( \Aimeos\MShop\Exception $e )
56
+		catch (\Aimeos\MShop\Exception $e)
57 57
 		{
58
-			$error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
59
-			$view->errors = $view->get( 'errors', [] ) + $error;
60
-			$this->logException( $e );
58
+			$error = array('product-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
59
+			$view->errors = $view->get('errors', []) + $error;
60
+			$this->logException($e);
61 61
 		}
62
-		catch( \Exception $e )
62
+		catch (\Exception $e)
63 63
 		{
64
-			$error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
65
-			$view->errors = $view->get( 'errors', [] ) + $error;
66
-			$this->logException( $e );
64
+			$error = array('product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
65
+			$view->errors = $view->get('errors', []) + $error;
66
+			$this->logException($e);
67 67
 		}
68 68
 
69
-		return $this->render( $view );
69
+		return $this->render($view);
70 70
 	}
71 71
 
72 72
 
@@ -82,10 +82,10 @@  discard block
 block discarded – undo
82 82
 
83 83
 		try
84 84
 		{
85
-			$data = $view->param( 'item', [] );
85
+			$data = $view->param('item', []);
86 86
 
87
-			if( !isset( $view->item ) ) {
88
-				$view->item = \Aimeos\MShop\Factory::createManager( $context, 'product' )->createItem();
87
+			if (!isset($view->item)) {
88
+				$view->item = \Aimeos\MShop\Factory::createManager($context, 'product')->createItem();
89 89
 			}
90 90
 
91 91
 			$data['product.siteid'] = $view->item->getSiteId();
@@ -95,26 +95,26 @@  discard block
 block discarded – undo
95 95
 			$view->itemData = $data;
96 96
 			$view->itemBody = '';
97 97
 
98
-			foreach( $this->getSubClients() as $idx => $client )
98
+			foreach ($this->getSubClients() as $idx => $client)
99 99
 			{
100 100
 				$view->tabindex = ++$idx + 1;
101 101
 				$view->itemBody .= $client->create();
102 102
 			}
103 103
 		}
104
-		catch( \Aimeos\MShop\Exception $e )
104
+		catch (\Aimeos\MShop\Exception $e)
105 105
 		{
106
-			$error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
107
-			$view->errors = $view->get( 'errors', [] ) + $error;
108
-			$this->logException( $e );
106
+			$error = array('product-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
107
+			$view->errors = $view->get('errors', []) + $error;
108
+			$this->logException($e);
109 109
 		}
110
-		catch( \Exception $e )
110
+		catch (\Exception $e)
111 111
 		{
112
-			$error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
113
-			$view->errors = $view->get( 'errors', [] ) + $error;
114
-			$this->logException( $e );
112
+			$error = array('product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
113
+			$view->errors = $view->get('errors', []) + $error;
114
+			$this->logException($e);
115 115
 		}
116 116
 
117
-		return $this->render( $view );
117
+		return $this->render($view);
118 118
 	}
119 119
 
120 120
 
@@ -128,39 +128,39 @@  discard block
 block discarded – undo
128 128
 		$view = $this->getView();
129 129
 		$context = $this->getContext();
130 130
 
131
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'product' );
131
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'product');
132 132
 		$manager->begin();
133 133
 
134 134
 		try
135 135
 		{
136
-			if( ( $id = $view->param( 'id' ) ) === null ) {
137
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
136
+			if (($id = $view->param('id')) === null) {
137
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
138 138
 			}
139 139
 
140
-			$view->item = $manager->getItem( $id, $this->getDomains() );
140
+			$view->item = $manager->getItem($id, $this->getDomains());
141 141
 
142
-			foreach( $this->getSubClients() as $client ) {
142
+			foreach ($this->getSubClients() as $client) {
143 143
 				$client->delete();
144 144
 			}
145 145
 
146
-			$manager->saveItem( $view->item );
147
-			$manager->deleteItem( $id );
146
+			$manager->saveItem($view->item);
147
+			$manager->deleteItem($id);
148 148
 			$manager->commit();
149 149
 
150
-			$this->nextAction( $view, 'search', 'product', null, 'delete' );
150
+			$this->nextAction($view, 'search', 'product', null, 'delete');
151 151
 			return;
152 152
 		}
153
-		catch( \Aimeos\MShop\Exception $e )
153
+		catch (\Aimeos\MShop\Exception $e)
154 154
 		{
155
-			$error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
156
-			$view->errors = $view->get( 'errors', [] ) + $error;
157
-			$this->logException( $e );
155
+			$error = array('product-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
156
+			$view->errors = $view->get('errors', []) + $error;
157
+			$this->logException($e);
158 158
 		}
159
-		catch( \Exception $e )
159
+		catch (\Exception $e)
160 160
 		{
161
-			$error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
162
-			$view->errors = $view->get( 'errors', [] ) + $error;
163
-			$this->logException( $e );
161
+			$error = array('product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
162
+			$view->errors = $view->get('errors', []) + $error;
163
+			$this->logException($e);
164 164
 		}
165 165
 
166 166
 		$manager->rollback();
@@ -181,38 +181,38 @@  discard block
 block discarded – undo
181 181
 
182 182
 		try
183 183
 		{
184
-			if( ( $id = $view->param( 'id' ) ) === null ) {
185
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
184
+			if (($id = $view->param('id')) === null) {
185
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
186 186
 			}
187 187
 
188
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'product' );
188
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'product');
189 189
 
190
-			$view->item = $manager->getItem( $id, $this->getDomains() );
190
+			$view->item = $manager->getItem($id, $this->getDomains());
191 191
 			$view->itemSubparts = $this->getSubClientNames();
192
-			$view->itemData = $this->toArray( $view->item );
192
+			$view->itemData = $this->toArray($view->item);
193 193
 			$view->itemTypes = $this->getTypeItems();
194 194
 			$view->itemBody = '';
195 195
 
196
-			foreach( $this->getSubClients() as $idx => $client )
196
+			foreach ($this->getSubClients() as $idx => $client)
197 197
 			{
198 198
 				$view->tabindex = ++$idx + 1;
199 199
 				$view->itemBody .= $client->get();
200 200
 			}
201 201
 		}
202
-		catch( \Aimeos\MShop\Exception $e )
202
+		catch (\Aimeos\MShop\Exception $e)
203 203
 		{
204
-			$error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
205
-			$view->errors = $view->get( 'errors', [] ) + $error;
206
-			$this->logException( $e );
204
+			$error = array('product-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
205
+			$view->errors = $view->get('errors', []) + $error;
206
+			$this->logException($e);
207 207
 		}
208
-		catch( \Exception $e )
208
+		catch (\Exception $e)
209 209
 		{
210
-			$error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
211
-			$view->errors = $view->get( 'errors', [] ) + $error;
212
-			$this->logException( $e );
210
+			$error = array('product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
211
+			$view->errors = $view->get('errors', []) + $error;
212
+			$this->logException($e);
213 213
 		}
214 214
 
215
-		return $this->render( $view );
215
+		return $this->render($view);
216 216
 	}
217 217
 
218 218
 
@@ -226,40 +226,40 @@  discard block
 block discarded – undo
226 226
 		$view = $this->getView();
227 227
 		$context = $this->getContext();
228 228
 
229
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'product' );
229
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'product');
230 230
 		$manager->begin();
231 231
 
232 232
 		try
233 233
 		{
234
-			$item = $this->fromArray( $view->param( 'item', [] ) );
235
-			$view->item = $item->getId() ? $item : $manager->saveItem( $item );
234
+			$item = $this->fromArray($view->param('item', []));
235
+			$view->item = $item->getId() ? $item : $manager->saveItem($item);
236 236
 			$view->itemBody = '';
237 237
 
238
-			foreach( $this->getSubClients() as $client ) {
238
+			foreach ($this->getSubClients() as $client) {
239 239
 				$view->itemBody .= $client->save();
240 240
 			}
241 241
 
242
-			$manager->saveItem( clone $view->item );
242
+			$manager->saveItem(clone $view->item);
243 243
 			$manager->commit();
244 244
 
245
-			$this->nextAction( $view, $view->param( 'next' ), 'product', $view->item->getId(), 'save' );
245
+			$this->nextAction($view, $view->param('next'), 'product', $view->item->getId(), 'save');
246 246
 			return;
247 247
 		}
248
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
248
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
249 249
 		{
250 250
 			// fall through to create
251 251
 		}
252
-		catch( \Aimeos\MShop\Exception $e )
252
+		catch (\Aimeos\MShop\Exception $e)
253 253
 		{
254
-			$error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
255
-			$view->errors = $view->get( 'errors', [] ) + $error;
256
-			$this->logException( $e );
254
+			$error = array('product-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
255
+			$view->errors = $view->get('errors', []) + $error;
256
+			$this->logException($e);
257 257
 		}
258
-		catch( \Exception $e )
258
+		catch (\Exception $e)
259 259
 		{
260
-			$error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
261
-			$view->errors = $view->get( 'errors', [] ) + $error;
262
-			$this->logException( $e );
260
+			$error = array('product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
261
+			$view->errors = $view->get('errors', []) + $error;
262
+			$this->logException($e);
263 263
 		}
264 264
 
265 265
 		$manager->rollback();
@@ -281,35 +281,35 @@  discard block
 block discarded – undo
281 281
 		try
282 282
 		{
283 283
 			$total = 0;
284
-			$params = $this->storeSearchParams( $view->param(), 'product' );
285
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'product' );
284
+			$params = $this->storeSearchParams($view->param(), 'product');
285
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'product');
286 286
 
287 287
 			$search = $manager->createSearch();
288
-			$search->setSortations( [$search->sort( '+', 'product.id')] );
289
-			$search = $this->initCriteria( $search, $params );
288
+			$search->setSortations([$search->sort('+', 'product.id')]);
289
+			$search = $this->initCriteria($search, $params);
290 290
 
291
-			$view->items = $manager->searchItems( $search, array_diff( $this->getDomains(), ['product'] ), $total );
292
-			$view->filterAttributes = $manager->getSearchAttributes( true );
291
+			$view->items = $manager->searchItems($search, array_diff($this->getDomains(), ['product']), $total);
292
+			$view->filterAttributes = $manager->getSearchAttributes(true);
293 293
 			$view->filterOperators = $search->getOperators();
294 294
 			$view->itemTypes = $this->getTypeItems();
295 295
 			$view->total = $total;
296 296
 			$view->itemBody = '';
297 297
 
298
-			foreach( $this->getSubClients() as $client ) {
298
+			foreach ($this->getSubClients() as $client) {
299 299
 				$view->itemBody .= $client->search();
300 300
 			}
301 301
 		}
302
-		catch( \Aimeos\MShop\Exception $e )
302
+		catch (\Aimeos\MShop\Exception $e)
303 303
 		{
304
-			$error = array( 'product-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
305
-			$view->errors = $view->get( 'errors', [] ) + $error;
306
-			$this->logException( $e );
304
+			$error = array('product-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
305
+			$view->errors = $view->get('errors', []) + $error;
306
+			$this->logException($e);
307 307
 		}
308
-		catch( \Exception $e )
308
+		catch (\Exception $e)
309 309
 		{
310
-			$error = array( 'product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
311
-			$view->errors = $view->get( 'errors', [] ) + $error;
312
-			$this->logException( $e );
310
+			$error = array('product-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
311
+			$view->errors = $view->get('errors', []) + $error;
312
+			$this->logException($e);
313 313
 		}
314 314
 
315 315
 		/** admin/jqadm/product/template-list
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 		$tplconf = 'admin/jqadm/product/template-list';
335 335
 		$default = 'product/list-standard.php';
336 336
 
337
-		return $view->render( $view->config( $tplconf, $default ) );
337
+		return $view->render($view->config($tplconf, $default));
338 338
 	}
339 339
 
340 340
 
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 	 * @param string|null $name Name of the sub-client (Default if null)
346 346
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
347 347
 	 */
348
-	public function getSubClient( $type, $name = null )
348
+	public function getSubClient($type, $name = null)
349 349
 	{
350 350
 		/** admin/jqadm/product/decorators/excludes
351 351
 		 * Excludes decorators added by the "common" option from the product JQAdm client
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 		 * @see admin/jqadm/product/decorators/excludes
421 421
 		 * @see admin/jqadm/product/decorators/global
422 422
 		 */
423
-		return $this->createSubClient( 'product/' . $type, $name );
423
+		return $this->createSubClient('product/' . $type, $name);
424 424
 	}
425 425
 
426 426
 
@@ -442,9 +442,9 @@  discard block
 block discarded – undo
442 442
 		 * @since 2016.01
443 443
 		 * @category Developer
444 444
 		 */
445
-		$domains = array( 'attribute', 'media', 'price', 'product', 'product/property', 'text' );
445
+		$domains = array('attribute', 'media', 'price', 'product', 'product/property', 'text');
446 446
 
447
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/product/domains', $domains );
447
+		return $this->getContext()->getConfig()->get('admin/jqadm/product/domains', $domains);
448 448
 	}
449 449
 
450 450
 
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 		 * @since 2016.01
489 489
 		 * @category Developer
490 490
 		 */
491
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/product/standard/subparts', [] );
491
+		return $this->getContext()->getConfig()->get('admin/jqadm/product/standard/subparts', []);
492 492
 	}
493 493
 
494 494
 
@@ -499,12 +499,12 @@  discard block
 block discarded – undo
499 499
 	 */
500 500
 	protected function getTypeItems()
501 501
 	{
502
-		$typeManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product/type' );
502
+		$typeManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product/type');
503 503
 
504 504
 		$search = $typeManager->createSearch();
505
-		$search->setSortations( array( $search->sort( '+', 'product.type.label' ) ) );
505
+		$search->setSortations(array($search->sort('+', 'product.type.label')));
506 506
 
507
-		return $typeManager->searchItems( $search );
507
+		return $typeManager->searchItems($search);
508 508
 	}
509 509
 
510 510
 
@@ -514,31 +514,31 @@  discard block
 block discarded – undo
514 514
 	 * @param string[] Data array
515 515
 	 * @return \Aimeos\MShop\Product\Item\Iface New product item object
516 516
 	 */
517
-	protected function fromArray( array $data )
517
+	protected function fromArray(array $data)
518 518
 	{
519 519
 		$conf = [];
520 520
 
521
-		if( isset( $data['config']['key'] ) )
521
+		if (isset($data['config']['key']))
522 522
 		{
523
-			foreach( (array) $data['config']['key'] as $idx => $key )
523
+			foreach ((array) $data['config']['key'] as $idx => $key)
524 524
 			{
525
-				if( trim( $key ) !== '' && isset( $data['config']['val'][$idx] ) ) {
525
+				if (trim($key) !== '' && isset($data['config']['val'][$idx])) {
526 526
 					$conf[$key] = $data['config']['val'][$idx];
527 527
 				}
528 528
 			}
529 529
 		}
530 530
 
531
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product' );
531
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product');
532 532
 
533
-		if( isset( $data['product.id'] ) && $data['product.id'] != '' ) {
534
-			$item = $manager->getItem( $data['product.id'], $this->getDomains() );
533
+		if (isset($data['product.id']) && $data['product.id'] != '') {
534
+			$item = $manager->getItem($data['product.id'], $this->getDomains());
535 535
 		} else {
536
-			$typeManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product/type' );
537
-			$item = $manager->createItem( $typeManager->getItem( $data['product.typeid'] )->getCode(), 'product' );
536
+			$typeManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product/type');
537
+			$item = $manager->createItem($typeManager->getItem($data['product.typeid'])->getCode(), 'product');
538 538
 		}
539 539
 
540
-		$item->fromArray( $data );
541
-		$item->setConfig( $conf );
540
+		$item->fromArray($data);
541
+		$item->setConfig($conf);
542 542
 
543 543
 		return $item;
544 544
 	}
@@ -550,19 +550,19 @@  discard block
 block discarded – undo
550 550
 	 * @param \Aimeos\MShop\Product\Item\Iface $item Product item object
551 551
 	 * @return string[] Multi-dimensional associative list of item data
552 552
 	 */
553
-	protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false )
553
+	protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false)
554 554
 	{
555
-		$data = $item->toArray( true );
555
+		$data = $item->toArray(true);
556 556
 		$data['config'] = [];
557 557
 
558
-		if( $copy === true )
558
+		if ($copy === true)
559 559
 		{
560 560
 			$data['product.siteid'] = $this->getContext()->getLocale()->getSiteId();
561 561
 			$data['product.code'] = $data['product.code'] . '_copy';
562 562
 			$data['product.id'] = '';
563 563
 		}
564 564
 
565
-		foreach( $item->getConfig() as $key => $value )
565
+		foreach ($item->getConfig() as $key => $value)
566 566
 		{
567 567
 			$data['config']['key'][] = $key;
568 568
 			$data['config']['val'][] = $value;
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
579 579
 	 * @return string HTML output
580 580
 	 */
581
-	protected function render( \Aimeos\MW\View\Iface $view )
581
+	protected function render(\Aimeos\MW\View\Iface $view)
582 582
 	{
583 583
 		/** admin/jqadm/product/template-item
584 584
 		 * Relative path to the HTML body template for the product item.
@@ -602,6 +602,6 @@  discard block
 block discarded – undo
602 602
 		$tplconf = 'admin/jqadm/product/template-item';
603 603
 		$default = 'product/item-standard.php';
604 604
 
605
-		return $view->render( $view->config( $tplconf, $default ) );
605
+		return $view->render($view->config($tplconf, $default));
606 606
 	}
607 607
 }
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Locale/Standard.php 2 patches
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -90,14 +90,12 @@  discard block
 block discarded – undo
90 90
 				$view->tabindex = ++$idx + 1;
91 91
 				$view->itemBody .= $client->copy();
92 92
 			}
93
-		}
94
-		catch( \Aimeos\MShop\Exception $e )
93
+		} catch( \Aimeos\MShop\Exception $e )
95 94
 		{
96 95
 			$error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
97 96
 			$view->errors = $view->get( 'errors', [] ) + $error;
98 97
 			$this->logException( $e );
99
-		}
100
-		catch( \Exception $e )
98
+		} catch( \Exception $e )
101 99
 		{
102 100
 			$error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
103 101
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -141,14 +139,12 @@  discard block
 block discarded – undo
141 139
 				$view->tabindex = ++$idx + 1;
142 140
 				$view->itemBody .= $client->create();
143 141
 			}
144
-		}
145
-		catch( \Aimeos\MShop\Exception $e )
142
+		} catch( \Aimeos\MShop\Exception $e )
146 143
 		{
147 144
 			$error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
148 145
 			$view->errors = $view->get( 'errors', [] ) + $error;
149 146
 			$this->logException( $e );
150
-		}
151
-		catch( \Exception $e )
147
+		} catch( \Exception $e )
152 148
 		{
153 149
 			$error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
154 150
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -189,14 +185,12 @@  discard block
 block discarded – undo
189 185
 
190 186
 			$this->nextAction( $view, 'search', 'locale', null, 'delete' );
191 187
 			return;
192
-		}
193
-		catch( \Aimeos\MShop\Exception $e )
188
+		} catch( \Aimeos\MShop\Exception $e )
194 189
 		{
195 190
 			$error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
196 191
 			$view->errors = $view->get( 'errors', [] ) + $error;
197 192
 			$this->logException( $e );
198
-		}
199
-		catch( \Exception $e )
193
+		} catch( \Exception $e )
200 194
 		{
201 195
 			$error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
202 196
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -239,14 +233,12 @@  discard block
 block discarded – undo
239 233
 				$view->tabindex = ++$idx + 1;
240 234
 				$view->itemBody .= $client->get();
241 235
 			}
242
-		}
243
-		catch( \Aimeos\MShop\Exception $e )
236
+		} catch( \Aimeos\MShop\Exception $e )
244 237
 		{
245 238
 			$error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
246 239
 			$view->errors = $view->get( 'errors', [] ) + $error;
247 240
 			$this->logException( $e );
248
-		}
249
-		catch( \Exception $e )
241
+		} catch( \Exception $e )
250 242
 		{
251 243
 			$error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
252 244
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -283,18 +275,15 @@  discard block
 block discarded – undo
283 275
 
284 276
 			$this->nextAction( $view, $view->param( 'next' ), 'locale', $view->item->getId(), 'save' );
285 277
 			return;
286
-		}
287
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
278
+		} catch( \Aimeos\Admin\JQAdm\Exception $e )
288 279
 		{
289 280
 			// fall through to create
290
-		}
291
-		catch( \Aimeos\MShop\Exception $e )
281
+		} catch( \Aimeos\MShop\Exception $e )
292 282
 		{
293 283
 			$error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
294 284
 			$view->errors = $view->get( 'errors', [] ) + $error;
295 285
 			$this->logException( $e );
296
-		}
297
-		catch( \Exception $e )
286
+		} catch( \Exception $e )
298 287
 		{
299 288
 			$error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
300 289
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -333,14 +322,12 @@  discard block
 block discarded – undo
333 322
 			foreach( $this->getSubClients() as $client ) {
334 323
 				$view->itemBody .= $client->search();
335 324
 			}
336
-		}
337
-		catch( \Aimeos\MShop\Exception $e )
325
+		} catch( \Aimeos\MShop\Exception $e )
338 326
 		{
339 327
 			$error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
340 328
 			$view->errors = $view->get( 'errors', [] ) + $error;
341 329
 			$this->logException( $e );
342
-		}
343
-		catch( \Exception $e )
330
+		} catch( \Exception $e )
344 331
 		{
345 332
 			$error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
346 333
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 namespace Aimeos\Admin\JQAdm\Locale;
12 12
 
13
-sprintf( 'locale' ); // for translation
13
+sprintf('locale'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -35,39 +35,39 @@  discard block
 block discarded – undo
35 35
 
36 36
 		try
37 37
 		{
38
-			if( ( $id = $view->param( 'id' ) ) === null ) {
39
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
38
+			if (($id = $view->param('id')) === null) {
39
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
40 40
 			}
41 41
 
42
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
43
-			$view->item = $manager->getItem( $id );
42
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'locale');
43
+			$view->item = $manager->getItem($id);
44 44
 
45
-			$view->itemData = $this->toArray( $view->item, true );
45
+			$view->itemData = $this->toArray($view->item, true);
46 46
 			$view->itemSubparts = $this->getSubClientNames();
47 47
 			$view->itemCurrencies = $this->getCurrencyItems();
48 48
 			$view->itemLanguages = $this->getLanguageItems();
49 49
 			$view->itemBody = '';
50 50
 
51
-			foreach( $this->getSubClients() as $idx => $client )
51
+			foreach ($this->getSubClients() as $idx => $client)
52 52
 			{
53 53
 				$view->tabindex = ++$idx + 1;
54 54
 				$view->itemBody .= $client->copy();
55 55
 			}
56 56
 		}
57
-		catch( \Aimeos\MShop\Exception $e )
57
+		catch (\Aimeos\MShop\Exception $e)
58 58
 		{
59
-			$error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
60
-			$view->errors = $view->get( 'errors', [] ) + $error;
61
-			$this->logException( $e );
59
+			$error = array('locale-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
60
+			$view->errors = $view->get('errors', []) + $error;
61
+			$this->logException($e);
62 62
 		}
63
-		catch( \Exception $e )
63
+		catch (\Exception $e)
64 64
 		{
65
-			$error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
66
-			$view->errors = $view->get( 'errors', [] ) + $error;
67
-			$this->logException( $e );
65
+			$error = array('locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
66
+			$view->errors = $view->get('errors', []) + $error;
67
+			$this->logException($e);
68 68
 		}
69 69
 
70
-		return $this->render( $view );
70
+		return $this->render($view);
71 71
 	}
72 72
 
73 73
 
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
 
84 84
 		try
85 85
 		{
86
-			$data = $view->param( 'item', [] );
86
+			$data = $view->param('item', []);
87 87
 
88
-			if( !isset( $view->item ) ) {
89
-				$view->item = \Aimeos\MShop\Factory::createManager( $context, 'locale' )->createItem();
88
+			if (!isset($view->item)) {
89
+				$view->item = \Aimeos\MShop\Factory::createManager($context, 'locale')->createItem();
90 90
 			}
91 91
 
92 92
 			$data['locale.siteid'] = $view->item->getSiteId();
@@ -97,26 +97,26 @@  discard block
 block discarded – undo
97 97
 			$view->itemData = $data;
98 98
 			$view->itemBody = '';
99 99
 
100
-			foreach( $this->getSubClients() as $idx => $client )
100
+			foreach ($this->getSubClients() as $idx => $client)
101 101
 			{
102 102
 				$view->tabindex = ++$idx + 1;
103 103
 				$view->itemBody .= $client->create();
104 104
 			}
105 105
 		}
106
-		catch( \Aimeos\MShop\Exception $e )
106
+		catch (\Aimeos\MShop\Exception $e)
107 107
 		{
108
-			$error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
109
-			$view->errors = $view->get( 'errors', [] ) + $error;
110
-			$this->logException( $e );
108
+			$error = array('locale-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
109
+			$view->errors = $view->get('errors', []) + $error;
110
+			$this->logException($e);
111 111
 		}
112
-		catch( \Exception $e )
112
+		catch (\Exception $e)
113 113
 		{
114
-			$error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
115
-			$view->errors = $view->get( 'errors', [] ) + $error;
116
-			$this->logException( $e );
114
+			$error = array('locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
115
+			$view->errors = $view->get('errors', []) + $error;
116
+			$this->logException($e);
117 117
 		}
118 118
 
119
-		return $this->render( $view );
119
+		return $this->render($view);
120 120
 	}
121 121
 
122 122
 
@@ -130,38 +130,38 @@  discard block
 block discarded – undo
130 130
 		$view = $this->getView();
131 131
 		$context = $this->getContext();
132 132
 
133
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
133
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'locale');
134 134
 		$manager->begin();
135 135
 
136 136
 		try
137 137
 		{
138
-			if( ( $id = $view->param( 'id' ) ) === null ) {
139
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
138
+			if (($id = $view->param('id')) === null) {
139
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
140 140
 			}
141 141
 
142
-			$view->item = $manager->getItem( $id );
142
+			$view->item = $manager->getItem($id);
143 143
 
144
-			foreach( $this->getSubClients() as $client ) {
144
+			foreach ($this->getSubClients() as $client) {
145 145
 				$client->delete();
146 146
 			}
147 147
 
148
-			$manager->deleteItem( $id );
148
+			$manager->deleteItem($id);
149 149
 			$manager->commit();
150 150
 
151
-			$this->nextAction( $view, 'search', 'locale', null, 'delete' );
151
+			$this->nextAction($view, 'search', 'locale', null, 'delete');
152 152
 			return;
153 153
 		}
154
-		catch( \Aimeos\MShop\Exception $e )
154
+		catch (\Aimeos\MShop\Exception $e)
155 155
 		{
156
-			$error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
157
-			$view->errors = $view->get( 'errors', [] ) + $error;
158
-			$this->logException( $e );
156
+			$error = array('locale-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
157
+			$view->errors = $view->get('errors', []) + $error;
158
+			$this->logException($e);
159 159
 		}
160
-		catch( \Exception $e )
160
+		catch (\Exception $e)
161 161
 		{
162
-			$error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
163
-			$view->errors = $view->get( 'errors', [] ) + $error;
164
-			$this->logException( $e );
162
+			$error = array('locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
163
+			$view->errors = $view->get('errors', []) + $error;
164
+			$this->logException($e);
165 165
 		}
166 166
 
167 167
 		$manager->rollback();
@@ -182,39 +182,39 @@  discard block
 block discarded – undo
182 182
 
183 183
 		try
184 184
 		{
185
-			if( ( $id = $view->param( 'id' ) ) === null ) {
186
-				throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) );
185
+			if (($id = $view->param('id')) === null) {
186
+				throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id'));
187 187
 			}
188 188
 
189
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
189
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'locale');
190 190
 
191
-			$view->item = $manager->getItem( $id );
191
+			$view->item = $manager->getItem($id);
192 192
 			$view->itemSubparts = $this->getSubClientNames();
193
-			$view->itemData = $this->toArray( $view->item );
193
+			$view->itemData = $this->toArray($view->item);
194 194
 			$view->itemCurrencies = $this->getCurrencyItems();
195 195
 			$view->itemLanguages = $this->getLanguageItems();
196 196
 			$view->itemBody = '';
197 197
 
198
-			foreach( $this->getSubClients() as $idx => $client )
198
+			foreach ($this->getSubClients() as $idx => $client)
199 199
 			{
200 200
 				$view->tabindex = ++$idx + 1;
201 201
 				$view->itemBody .= $client->get();
202 202
 			}
203 203
 		}
204
-		catch( \Aimeos\MShop\Exception $e )
204
+		catch (\Aimeos\MShop\Exception $e)
205 205
 		{
206
-			$error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
207
-			$view->errors = $view->get( 'errors', [] ) + $error;
208
-			$this->logException( $e );
206
+			$error = array('locale-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
207
+			$view->errors = $view->get('errors', []) + $error;
208
+			$this->logException($e);
209 209
 		}
210
-		catch( \Exception $e )
210
+		catch (\Exception $e)
211 211
 		{
212
-			$error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
213
-			$view->errors = $view->get( 'errors', [] ) + $error;
214
-			$this->logException( $e );
212
+			$error = array('locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
213
+			$view->errors = $view->get('errors', []) + $error;
214
+			$this->logException($e);
215 215
 		}
216 216
 
217
-		return $this->render( $view );
217
+		return $this->render($view);
218 218
 	}
219 219
 
220 220
 
@@ -228,40 +228,40 @@  discard block
 block discarded – undo
228 228
 		$view = $this->getView();
229 229
 		$context = $this->getContext();
230 230
 
231
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
231
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'locale');
232 232
 		$manager->begin();
233 233
 
234 234
 		try
235 235
 		{
236
-			$item = $this->fromArray( $view->param( 'item', [] ) );
237
-			$view->item = $item->getId() ? $item : $manager->saveItem( $item );
236
+			$item = $this->fromArray($view->param('item', []));
237
+			$view->item = $item->getId() ? $item : $manager->saveItem($item);
238 238
 			$view->itemBody = '';
239 239
 
240
-			foreach( $this->getSubClients() as $client ) {
240
+			foreach ($this->getSubClients() as $client) {
241 241
 				$view->itemBody .= $client->save();
242 242
 			}
243 243
 
244
-			$manager->saveItem( $view->item );
244
+			$manager->saveItem($view->item);
245 245
 			$manager->commit();
246 246
 
247
-			$this->nextAction( $view, $view->param( 'next' ), 'locale', $view->item->getId(), 'save' );
247
+			$this->nextAction($view, $view->param('next'), 'locale', $view->item->getId(), 'save');
248 248
 			return;
249 249
 		}
250
-		catch( \Aimeos\Admin\JQAdm\Exception $e )
250
+		catch (\Aimeos\Admin\JQAdm\Exception $e)
251 251
 		{
252 252
 			// fall through to create
253 253
 		}
254
-		catch( \Aimeos\MShop\Exception $e )
254
+		catch (\Aimeos\MShop\Exception $e)
255 255
 		{
256
-			$error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
257
-			$view->errors = $view->get( 'errors', [] ) + $error;
258
-			$this->logException( $e );
256
+			$error = array('locale-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
257
+			$view->errors = $view->get('errors', []) + $error;
258
+			$this->logException($e);
259 259
 		}
260
-		catch( \Exception $e )
260
+		catch (\Exception $e)
261 261
 		{
262
-			$error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
263
-			$view->errors = $view->get( 'errors', [] ) + $error;
264
-			$this->logException( $e );
262
+			$error = array('locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
263
+			$view->errors = $view->get('errors', []) + $error;
264
+			$this->logException($e);
265 265
 		}
266 266
 
267 267
 		$manager->rollback();
@@ -283,31 +283,31 @@  discard block
 block discarded – undo
283 283
 		try
284 284
 		{
285 285
 			$total = 0;
286
-			$params = $this->storeSearchParams( $view->param(), 'locale' );
287
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'locale' );
288
-			$search = $this->initCriteria( $manager->createSearch(), $params );
286
+			$params = $this->storeSearchParams($view->param(), 'locale');
287
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'locale');
288
+			$search = $this->initCriteria($manager->createSearch(), $params);
289 289
 
290
-			$view->items = $manager->searchItems( $search, [], $total );
291
-			$view->filterAttributes = $manager->getSearchAttributes( true );
290
+			$view->items = $manager->searchItems($search, [], $total);
291
+			$view->filterAttributes = $manager->getSearchAttributes(true);
292 292
 			$view->filterOperators = $search->getOperators();
293 293
 			$view->total = $total;
294 294
 			$view->itemBody = '';
295 295
 
296
-			foreach( $this->getSubClients() as $client ) {
296
+			foreach ($this->getSubClients() as $client) {
297 297
 				$view->itemBody .= $client->search();
298 298
 			}
299 299
 		}
300
-		catch( \Aimeos\MShop\Exception $e )
300
+		catch (\Aimeos\MShop\Exception $e)
301 301
 		{
302
-			$error = array( 'locale-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
303
-			$view->errors = $view->get( 'errors', [] ) + $error;
304
-			$this->logException( $e );
302
+			$error = array('locale-item' => $context->getI18n()->dt('mshop', $e->getMessage()));
303
+			$view->errors = $view->get('errors', []) + $error;
304
+			$this->logException($e);
305 305
 		}
306
-		catch( \Exception $e )
306
+		catch (\Exception $e)
307 307
 		{
308
-			$error = array( 'locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
309
-			$view->errors = $view->get( 'errors', [] ) + $error;
310
-			$this->logException( $e );
308
+			$error = array('locale-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
309
+			$view->errors = $view->get('errors', []) + $error;
310
+			$this->logException($e);
311 311
 		}
312 312
 
313 313
 		/** admin/jqadm/locale/template-list
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 		$tplconf = 'admin/jqadm/locale/template-list';
333 333
 		$default = 'locale/list-standard.php';
334 334
 
335
-		return $view->render( $view->config( $tplconf, $default ) );
335
+		return $view->render($view->config($tplconf, $default));
336 336
 	}
337 337
 
338 338
 
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 	 * @param string|null $name Name of the sub-client (Default if null)
344 344
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
345 345
 	 */
346
-	public function getSubClient( $type, $name = null )
346
+	public function getSubClient($type, $name = null)
347 347
 	{
348 348
 		/** admin/jqadm/locale/decorators/excludes
349 349
 		 * Excludes decorators added by the "common" option from the locale JQAdm client
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 		 * @see admin/jqadm/locale/decorators/excludes
419 419
 		 * @see admin/jqadm/locale/decorators/global
420 420
 		 */
421
-		return $this->createSubClient( 'locale/' . $type, $name );
421
+		return $this->createSubClient('locale/' . $type, $name);
422 422
 	}
423 423
 
424 424
 
@@ -429,13 +429,13 @@  discard block
 block discarded – undo
429 429
 	 */
430 430
 	protected function getCurrencyItems()
431 431
 	{
432
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'locale/currency' );
432
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'locale/currency');
433 433
 
434
-		$search = $manager->createSearch( true );
435
-		$search->setSortations( [$search->sort( '+', 'locale.currency.id')] );
436
-		$search->setSlice( 0, 250 );
434
+		$search = $manager->createSearch(true);
435
+		$search->setSortations([$search->sort('+', 'locale.currency.id')]);
436
+		$search->setSlice(0, 250);
437 437
 
438
-		return $manager->searchItems( $search );
438
+		return $manager->searchItems($search);
439 439
 	}
440 440
 
441 441
 
@@ -446,13 +446,13 @@  discard block
 block discarded – undo
446 446
 	 */
447 447
 	protected function getLanguageItems()
448 448
 	{
449
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'locale/language' );
449
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'locale/language');
450 450
 
451
-		$search = $manager->createSearch( true );
452
-		$search->setSortations( [$search->sort( '+', 'locale.language.id')] );
453
-		$search->setSlice( 0, 250 );
451
+		$search = $manager->createSearch(true);
452
+		$search->setSortations([$search->sort('+', 'locale.language.id')]);
453
+		$search->setSlice(0, 250);
454 454
 
455
-		return $manager->searchItems( $search );
455
+		return $manager->searchItems($search);
456 456
 	}
457 457
 
458 458
 
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
 		 * @since 2017.10
497 497
 		 * @category Developer
498 498
 		 */
499
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/locale/standard/subparts', [] );
499
+		return $this->getContext()->getConfig()->get('admin/jqadm/locale/standard/subparts', []);
500 500
 	}
501 501
 
502 502
 
@@ -507,17 +507,17 @@  discard block
 block discarded – undo
507 507
 	 * @param string[] Data array
508 508
 	 * @return \Aimeos\MShop\Locale\Item\Iface New locale item object
509 509
 	 */
510
-	protected function fromArray( array $data )
510
+	protected function fromArray(array $data)
511 511
 	{
512
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'locale' );
512
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'locale');
513 513
 
514
-		if( isset( $data['locale.id'] ) && $data['locale.id'] != '' ) {
515
-			$item = $manager->getItem( $data['locale.id'] );
514
+		if (isset($data['locale.id']) && $data['locale.id'] != '') {
515
+			$item = $manager->getItem($data['locale.id']);
516 516
 		} else {
517 517
 			$item = $manager->createItem();
518 518
 		}
519 519
 
520
-		$item->fromArray( $data );
520
+		$item->fromArray($data);
521 521
 
522 522
 		return $item;
523 523
 	}
@@ -529,11 +529,11 @@  discard block
 block discarded – undo
529 529
 	 * @param \Aimeos\MShop\Locale\Item\Iface $item Locale item object
530 530
 	 * @return string[] Multi-dimensional associative list of item data
531 531
 	 */
532
-	protected function toArray( \Aimeos\MShop\Locale\Item\Iface $item, $copy = false )
532
+	protected function toArray(\Aimeos\MShop\Locale\Item\Iface $item, $copy = false)
533 533
 	{
534
-		$data = $item->toArray( true );
534
+		$data = $item->toArray(true);
535 535
 
536
-		if( $copy === true )
536
+		if ($copy === true)
537 537
 		{
538 538
 			$data['locale.siteid'] = $this->getContext()->getLocale()->getSiteId();
539 539
 			$data['locale.id'] = '';
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
550 550
 	 * @return string HTML output
551 551
 	 */
552
-	protected function render( \Aimeos\MW\View\Iface $view )
552
+	protected function render(\Aimeos\MW\View\Iface $view)
553 553
 	{
554 554
 		/** admin/jqadm/locale/template-item
555 555
 		 * Relative path to the HTML body template for the locale item.
@@ -573,6 +573,6 @@  discard block
 block discarded – undo
573 573
 		$tplconf = 'admin/jqadm/locale/template-item';
574 574
 		$default = 'locale/item-standard.php';
575 575
 
576
-		return $view->render( $view->config( $tplconf, $default ) );
576
+		return $view->render($view->config($tplconf, $default));
577 577
 	}
578 578
 }
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Customer/Product/Standard.php 2 patches
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -77,14 +77,12 @@  discard block
 block discarded – undo
77 77
 			foreach( $this->getSubClients() as $client ) {
78 78
 				$view->productBody .= $client->copy();
79 79
 			}
80
-		}
81
-		catch( \Aimeos\MShop\Exception $e )
80
+		} catch( \Aimeos\MShop\Exception $e )
82 81
 		{
83 82
 			$error = array( 'customer-product' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
84 83
 			$view->errors = $view->get( 'errors', [] ) + $error;
85 84
 			$this->logException( $e );
86
-		}
87
-		catch( \Exception $e )
85
+		} catch( \Exception $e )
88 86
 		{
89 87
 			$error = array( 'customer-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
90 88
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -112,14 +110,12 @@  discard block
 block discarded – undo
112 110
 			foreach( $this->getSubClients() as $client ) {
113 111
 				$view->productBody .= $client->create();
114 112
 			}
115
-		}
116
-		catch( \Aimeos\MShop\Exception $e )
113
+		} catch( \Aimeos\MShop\Exception $e )
117 114
 		{
118 115
 			$error = array( 'customer-product' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
119 116
 			$view->errors = $view->get( 'errors', [] ) + $error;
120 117
 			$this->logException( $e );
121
-		}
122
-		catch( \Exception $e )
118
+		} catch( \Exception $e )
123 119
 		{
124 120
 			$error = array( 'customer-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
125 121
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -154,14 +150,12 @@  discard block
 block discarded – undo
154 150
 			foreach( $this->getSubClients() as $client ) {
155 151
 				$view->productBody .= $client->search();
156 152
 			}
157
-		}
158
-		catch( \Aimeos\MShop\Exception $e )
153
+		} catch( \Aimeos\MShop\Exception $e )
159 154
 		{
160 155
 			$error = array( 'customer-product' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
161 156
 			$view->errors = $view->get( 'errors', [] ) + $error;
162 157
 			$this->logException( $e );
163
-		}
164
-		catch( \Exception $e )
158
+		} catch( \Exception $e )
165 159
 		{
166 160
 			$error = array( 'customer-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
167 161
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -196,14 +190,12 @@  discard block
 block discarded – undo
196 190
 
197 191
 			$manager->commit();
198 192
 			return;
199
-		}
200
-		catch( \Aimeos\MShop\Exception $e )
193
+		} catch( \Aimeos\MShop\Exception $e )
201 194
 		{
202 195
 			$error = array( 'customer-item-image' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
203 196
 			$view->errors = $view->get( 'errors', [] ) + $error;
204 197
 			$this->logException( $e );
205
-		}
206
-		catch( \Exception $e )
198
+		} catch( \Exception $e )
207 199
 		{
208 200
 			$error = array( 'customer-item-image' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
209 201
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 namespace Aimeos\Admin\JQAdm\Customer\Product;
12 12
 
13
-sprintf( 'product' ); // for translation
13
+sprintf('product'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -49,24 +49,24 @@  discard block
 block discarded – undo
49 49
 			$view->productListTypes = $this->getListTypes();
50 50
 			$view->productBody = '';
51 51
 
52
-			foreach( $this->getSubClients() as $client ) {
52
+			foreach ($this->getSubClients() as $client) {
53 53
 				$view->productBody .= $client->copy();
54 54
 			}
55 55
 		}
56
-		catch( \Aimeos\MShop\Exception $e )
56
+		catch (\Aimeos\MShop\Exception $e)
57 57
 		{
58
-			$error = array( 'customer-product' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
59
-			$view->errors = $view->get( 'errors', [] ) + $error;
60
-			$this->logException( $e );
58
+			$error = array('customer-product' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
59
+			$view->errors = $view->get('errors', []) + $error;
60
+			$this->logException($e);
61 61
 		}
62
-		catch( \Exception $e )
62
+		catch (\Exception $e)
63 63
 		{
64
-			$error = array( 'customer-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
65
-			$view->errors = $view->get( 'errors', [] ) + $error;
66
-			$this->logException( $e );
64
+			$error = array('customer-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
65
+			$view->errors = $view->get('errors', []) + $error;
66
+			$this->logException($e);
67 67
 		}
68 68
 
69
-		return $this->render( $view );
69
+		return $this->render($view);
70 70
 	}
71 71
 
72 72
 
@@ -84,24 +84,24 @@  discard block
 block discarded – undo
84 84
 			$view->productListTypes = $this->getListTypes();
85 85
 			$view->productBody = '';
86 86
 
87
-			foreach( $this->getSubClients() as $client ) {
87
+			foreach ($this->getSubClients() as $client) {
88 88
 				$view->productBody .= $client->create();
89 89
 			}
90 90
 		}
91
-		catch( \Aimeos\MShop\Exception $e )
91
+		catch (\Aimeos\MShop\Exception $e)
92 92
 		{
93
-			$error = array( 'customer-product' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
94
-			$view->errors = $view->get( 'errors', [] ) + $error;
95
-			$this->logException( $e );
93
+			$error = array('customer-product' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
94
+			$view->errors = $view->get('errors', []) + $error;
95
+			$this->logException($e);
96 96
 		}
97
-		catch( \Exception $e )
97
+		catch (\Exception $e)
98 98
 		{
99
-			$error = array( 'customer-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
100
-			$view->errors = $view->get( 'errors', [] ) + $error;
101
-			$this->logException( $e );
99
+			$error = array('customer-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
100
+			$view->errors = $view->get('errors', []) + $error;
101
+			$this->logException($e);
102 102
 		}
103 103
 
104
-		return $this->render( $view );
104
+		return $this->render($view);
105 105
 	}
106 106
 
107 107
 
@@ -117,33 +117,33 @@  discard block
 block discarded – undo
117 117
 		try
118 118
 		{
119 119
 			$total = 0;
120
-			$params = $this->storeSearchParams( $view->param( 'up', [] ), 'customerproduct' );
121
-			$listItems = $this->getListItems( $view->item, $params, $total );
120
+			$params = $this->storeSearchParams($view->param('up', []), 'customerproduct');
121
+			$listItems = $this->getListItems($view->item, $params, $total);
122 122
 
123
-			$view->productItems = $this->getProductItems( $listItems );
124
-			$view->productData = $this->toArray( $listItems );
123
+			$view->productItems = $this->getProductItems($listItems);
124
+			$view->productData = $this->toArray($listItems);
125 125
 			$view->productListTypes = $this->getListTypes();
126 126
 			$view->productTotal = $total;
127 127
 			$view->productBody = '';
128 128
 
129
-			foreach( $this->getSubClients() as $client ) {
129
+			foreach ($this->getSubClients() as $client) {
130 130
 				$view->productBody .= $client->search();
131 131
 			}
132 132
 		}
133
-		catch( \Aimeos\MShop\Exception $e )
133
+		catch (\Aimeos\MShop\Exception $e)
134 134
 		{
135
-			$error = array( 'customer-product' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
136
-			$view->errors = $view->get( 'errors', [] ) + $error;
137
-			$this->logException( $e );
135
+			$error = array('customer-product' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
136
+			$view->errors = $view->get('errors', []) + $error;
137
+			$this->logException($e);
138 138
 		}
139
-		catch( \Exception $e )
139
+		catch (\Exception $e)
140 140
 		{
141
-			$error = array( 'customer-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
142
-			$view->errors = $view->get( 'errors', [] ) + $error;
143
-			$this->logException( $e );
141
+			$error = array('customer-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
142
+			$view->errors = $view->get('errors', []) + $error;
143
+			$this->logException($e);
144 144
 		}
145 145
 
146
-		return $this->render( $view );
146
+		return $this->render($view);
147 147
 	}
148 148
 
149 149
 
@@ -155,34 +155,34 @@  discard block
 block discarded – undo
155 155
 		$view = $this->getView();
156 156
 		$context = $this->getContext();
157 157
 
158
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists' );
158
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists');
159 159
 
160 160
 		$manager->begin();
161 161
 
162 162
 		try
163 163
 		{
164
-			$this->storeSearchParams( $view->param( 'up', [] ), 'customerproduct' );
165
-			$this->fromArray( $view->item, $view->param( 'product', [] ) );
164
+			$this->storeSearchParams($view->param('up', []), 'customerproduct');
165
+			$this->fromArray($view->item, $view->param('product', []));
166 166
 			$view->productBody = '';
167 167
 
168
-			foreach( $this->getSubClients() as $client ) {
168
+			foreach ($this->getSubClients() as $client) {
169 169
 				$view->productBody .= $client->save();
170 170
 			}
171 171
 
172 172
 			$manager->commit();
173 173
 			return;
174 174
 		}
175
-		catch( \Aimeos\MShop\Exception $e )
175
+		catch (\Aimeos\MShop\Exception $e)
176 176
 		{
177
-			$error = array( 'customer-item-image' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
178
-			$view->errors = $view->get( 'errors', [] ) + $error;
179
-			$this->logException( $e );
177
+			$error = array('customer-item-image' => $context->getI18n()->dt('mshop', $e->getMessage()));
178
+			$view->errors = $view->get('errors', []) + $error;
179
+			$this->logException($e);
180 180
 		}
181
-		catch( \Exception $e )
181
+		catch (\Exception $e)
182 182
 		{
183
-			$error = array( 'customer-item-image' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
184
-			$view->errors = $view->get( 'errors', [] ) + $error;
185
-			$this->logException( $e );
183
+			$error = array('customer-item-image' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
184
+			$view->errors = $view->get('errors', []) + $error;
185
+			$this->logException($e);
186 186
 		}
187 187
 
188 188
 		$manager->rollback();
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 	 * @param string|null $name Name of the sub-client (Default if null)
199 199
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
200 200
 	 */
201
-	public function getSubClient( $type, $name = null )
201
+	public function getSubClient($type, $name = null)
202 202
 	{
203 203
 		/** admin/jqadm/customer/product/decorators/excludes
204 204
 		 * Excludes decorators added by the "common" option from the customer JQAdm client
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 		 * @see admin/jqadm/customer/product/decorators/excludes
274 274
 		 * @see admin/jqadm/customer/product/decorators/global
275 275
 		 */
276
-		return $this->createSubClient( 'customer/product/' . $type, $name );
276
+		return $this->createSubClient('customer/product/' . $type, $name);
277 277
 	}
278 278
 
279 279
 
@@ -285,22 +285,22 @@  discard block
 block discarded – undo
285 285
 	 * @param integer $total Value/result parameter that will contain the item total afterwards
286 286
 	 * @return \Aimeos\MShop\Common\Item\List\Iface[] Customer list items referencing the products
287 287
 	 */
288
-	protected function getListItems( \Aimeos\MShop\Customer\Item\Iface $item, array $params = [], &$total )
288
+	protected function getListItems(\Aimeos\MShop\Customer\Item\Iface $item, array $params = [], &$total)
289 289
 	{
290
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/lists' );
290
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/lists');
291 291
 
292 292
 		$search = $manager->createSearch();
293
-		$search->setSortations( [$search->sort( '-', 'customer.lists.ctime' )] );
293
+		$search->setSortations([$search->sort('-', 'customer.lists.ctime')]);
294 294
 
295
-		$search = $this->initCriteria( $search, $params );
295
+		$search = $this->initCriteria($search, $params);
296 296
 		$expr = [
297 297
 			$search->getConditions(),
298
-			$search->compare( '==', 'customer.lists.parentid', $item->getId() ),
299
-			$search->compare( '==', 'customer.lists.domain', 'product' ),
298
+			$search->compare('==', 'customer.lists.parentid', $item->getId()),
299
+			$search->compare('==', 'customer.lists.domain', 'product'),
300 300
 		];
301
-		$search->setConditions( $search->combine( '&&', $expr ) );
301
+		$search->setConditions($search->combine('&&', $expr));
302 302
 
303
-		return $manager->searchItems( $search, [], $total );
303
+		return $manager->searchItems($search, [], $total);
304 304
 	}
305 305
 
306 306
 
@@ -312,13 +312,13 @@  discard block
 block discarded – undo
312 312
 	protected function getListTypes()
313 313
 	{
314 314
 		$list = [];
315
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/lists/type' );
315
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/lists/type');
316 316
 
317
-		$search = $manager->createSearch()->setSlice( 0, 0x7fffffff );
318
-		$search->setConditions( $search->compare( '==', 'customer.lists.type.domain', 'product' ) );
319
-		$search->setSortations( [$search->sort( '+', 'customer.lists.type.code' )] );
317
+		$search = $manager->createSearch()->setSlice(0, 0x7fffffff);
318
+		$search->setConditions($search->compare('==', 'customer.lists.type.domain', 'product'));
319
+		$search->setSortations([$search->sort('+', 'customer.lists.type.code')]);
320 320
 
321
-		foreach( $manager->searchItems( $search ) as $id => $item ) {
321
+		foreach ($manager->searchItems($search) as $id => $item) {
322 322
 			$list[$id] = $item->getCode();
323 323
 		}
324 324
 
@@ -332,20 +332,20 @@  discard block
 block discarded – undo
332 332
 	 * @param \Aimeos\MShop\Common\Item\List\Iface[] $listItems Customer list items referencing the products
333 333
 	 * @return \Aimeos\MShop\Product\Item\Iface[] Associative list of product IDs as keys and items as values
334 334
 	 */
335
-	protected function getProductItems( array $listItems )
335
+	protected function getProductItems(array $listItems)
336 336
 	{
337 337
 		$list = [];
338 338
 
339
-		foreach( $listItems as $listItem ) {
339
+		foreach ($listItems as $listItem) {
340 340
 			$list[] = $listItem->getRefId();
341 341
 		}
342 342
 
343
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product' );
343
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product');
344 344
 
345
-		$search = $manager->createSearch()->setSlice( 0, count( $list ) );
346
-		$search->setConditions( $search->compare( '==', 'product.id', $list ) );
345
+		$search = $manager->createSearch()->setSlice(0, count($list));
346
+		$search->setConditions($search->compare('==', 'product.id', $list));
347 347
 
348
-		return $manager->searchItems( $search );
348
+		return $manager->searchItems($search);
349 349
 	}
350 350
 
351 351
 
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 		 * @since 2017.07
390 390
 		 * @category Developer
391 391
 		 */
392
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/customer/product/standard/subparts', [] );
392
+		return $this->getContext()->getConfig()->get('admin/jqadm/customer/product/standard/subparts', []);
393 393
 	}
394 394
 
395 395
 
@@ -399,75 +399,75 @@  discard block
 block discarded – undo
399 399
 	 * @param \Aimeos\MShop\Customer\Item\Iface $item Customer item object without referenced domain items
400 400
 	 * @param string[] $data Data array
401 401
 	 */
402
-	protected function fromArray( \Aimeos\MShop\Customer\Item\Iface $item, array $data )
402
+	protected function fromArray(\Aimeos\MShop\Customer\Item\Iface $item, array $data)
403 403
 	{
404 404
 		$context = $this->getContext();
405
-		$listIds = $this->getValue( $data, 'customer.lists.id', [] );
405
+		$listIds = $this->getValue($data, 'customer.lists.id', []);
406 406
 
407
-		$listManager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists' );
407
+		$listManager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists');
408 408
 
409
-		$search = $listManager->createSearch()->setSlice( 0, count( $listIds ) );
410
-		$search->setConditions( $search->compare( '==', 'customer.lists.id', $listIds ) );
409
+		$search = $listManager->createSearch()->setSlice(0, count($listIds));
410
+		$search->setConditions($search->compare('==', 'customer.lists.id', $listIds));
411 411
 
412
-		$listItems = $listManager->searchItems( $search );
412
+		$listItems = $listManager->searchItems($search);
413 413
 
414 414
 
415
-		foreach( (array) $listIds as $idx => $listid )
415
+		foreach ((array) $listIds as $idx => $listid)
416 416
 		{
417
-			if( isset( $listItems[$listid] ) ) {
417
+			if (isset($listItems[$listid])) {
418 418
 				$litem = $listItems[$listid];
419 419
 			} else {
420 420
 				$litem = $listManager->createItem();
421 421
 			}
422 422
 
423
-			$litem->setParentId( $item->getId() );
424
-			$litem->setDomain( 'product' );
423
+			$litem->setParentId($item->getId());
424
+			$litem->setDomain('product');
425 425
 
426
-			if( isset( $data['customer.lists.refid'][$idx] ) ) {
427
-				$litem->setRefId( $this->getValue( $data, 'customer.lists.refid/' . $idx ) );
426
+			if (isset($data['customer.lists.refid'][$idx])) {
427
+				$litem->setRefId($this->getValue($data, 'customer.lists.refid/' . $idx));
428 428
 			}
429 429
 
430
-			if( isset( $data['customer.lists.status'][$idx] ) ) {
431
-				$litem->setStatus( $this->getValue( $data, 'customer.lists.status/' . $idx ) );
430
+			if (isset($data['customer.lists.status'][$idx])) {
431
+				$litem->setStatus($this->getValue($data, 'customer.lists.status/' . $idx));
432 432
 			}
433 433
 
434
-			if( isset( $data['customer.lists.typeid'][$idx] ) ) {
435
-				$litem->setTypeId( $this->getValue( $data, 'customer.lists.typeid/' . $idx ) );
434
+			if (isset($data['customer.lists.typeid'][$idx])) {
435
+				$litem->setTypeId($this->getValue($data, 'customer.lists.typeid/' . $idx));
436 436
 			}
437 437
 
438
-			if( isset( $data['customer.lists.position'][$idx] ) ) {
439
-				$litem->setPosition( $this->getValue( $data, 'customer.lists.position/' . $idx ) );
438
+			if (isset($data['customer.lists.position'][$idx])) {
439
+				$litem->setPosition($this->getValue($data, 'customer.lists.position/' . $idx));
440 440
 			}
441 441
 
442
-			if( isset( $data['customer.lists.datestart'][$idx] ) ) {
443
-				$litem->setDateStart( $this->getValue( $data, 'customer.lists.datestart/' . $idx ) );
442
+			if (isset($data['customer.lists.datestart'][$idx])) {
443
+				$litem->setDateStart($this->getValue($data, 'customer.lists.datestart/' . $idx));
444 444
 			}
445 445
 
446
-			if( isset( $data['customer.lists.dateend'][$idx] ) ) {
447
-				$litem->setDateEnd( $this->getValue( $data, 'customer.lists.dateend/' . $idx ) );
446
+			if (isset($data['customer.lists.dateend'][$idx])) {
447
+				$litem->setDateEnd($this->getValue($data, 'customer.lists.dateend/' . $idx));
448 448
 			}
449 449
 
450
-			if( isset( $data['customer.lists.config'][$idx] )
451
-				&& ( $conf = json_decode( $this->getValue( $data, 'customer.lists.config/' . $idx ), true ) ) !== null
450
+			if (isset($data['customer.lists.config'][$idx])
451
+				&& ($conf = json_decode($this->getValue($data, 'customer.lists.config/' . $idx), true)) !== null
452 452
 			) {
453
-				$litem->setConfig( $conf );
453
+				$litem->setConfig($conf);
454 454
 			}
455 455
 
456
-			if( $litem->getId() === null && isset( $data['config'][$idx]['key'] ) )
456
+			if ($litem->getId() === null && isset($data['config'][$idx]['key']))
457 457
 			{
458 458
 				$conf = [];
459 459
 
460
-				foreach( (array) $data['config'][$idx]['key'] as $pos => $key )
460
+				foreach ((array) $data['config'][$idx]['key'] as $pos => $key)
461 461
 				{
462
-					if( trim( $key ) !== '' && isset( $data['config'][$idx]['val'][$pos] ) ) {
462
+					if (trim($key) !== '' && isset($data['config'][$idx]['val'][$pos])) {
463 463
 						$conf[$key] = $data['config'][$idx]['val'][$pos];
464 464
 					}
465 465
 				}
466 466
 
467
-				$litem->setConfig( $conf );
467
+				$litem->setConfig($conf);
468 468
 			}
469 469
 
470
-			$listManager->saveItem( $litem, false );
470
+			$listManager->saveItem($litem, false);
471 471
 		}
472 472
 	}
473 473
 
@@ -478,13 +478,13 @@  discard block
 block discarded – undo
478 478
 	 * @param \Aimeos\MShop\Common\Item\Lists\Iface[] $listItems Customer list items referencing the products
479 479
 	 * @return string[] Multi-dimensional associative list of item data
480 480
 	 */
481
-	protected function toArray( array $listItems )
481
+	protected function toArray(array $listItems)
482 482
 	{
483 483
 		$data = [];
484 484
 
485
-		foreach( $listItems as $listItem )
485
+		foreach ($listItems as $listItem)
486 486
 		{
487
-			foreach( $listItem->toArray( true ) as $key => $value ) {
487
+			foreach ($listItem->toArray(true) as $key => $value) {
488 488
 				$data[$key][] = $value;
489 489
 			}
490 490
 		}
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
500 500
 	 * @return string HTML output
501 501
 	 */
502
-	protected function render( \Aimeos\MW\View\Iface $view )
502
+	protected function render(\Aimeos\MW\View\Iface $view)
503 503
 	{
504 504
 		/** admin/jqadm/customer/product/template-item
505 505
 		 * Relative path to the HTML body template of the product subpart for customers.
@@ -523,6 +523,6 @@  discard block
 block discarded – undo
523 523
 		$tplconf = 'admin/jqadm/customer/product/template-item';
524 524
 		$default = 'customer/item-product-standard.php';
525 525
 
526
-		return $view->render( $view->config( $tplconf, $default ) );
526
+		return $view->render($view->config($tplconf, $default));
527 527
 	}
528 528
 }
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Customer/Order/Standard.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -106,14 +106,12 @@
 block discarded – undo
106 106
 			foreach( $this->getSubClients() as $client ) {
107 107
 				$view->orderBody .= $client->search();
108 108
 			}
109
-		}
110
-		catch( \Aimeos\MShop\Exception $e )
109
+		} catch( \Aimeos\MShop\Exception $e )
111 110
 		{
112 111
 			$error = array( 'customer-order' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
113 112
 			$view->errors = $view->get( 'errors', [] ) + $error;
114 113
 			$this->logException( $e );
115
-		}
116
-		catch( \Exception $e )
114
+		} catch( \Exception $e )
117 115
 		{
118 116
 			$error = array( 'customer-order' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
119 117
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 namespace Aimeos\Admin\JQAdm\Customer\Order;
12 12
 
13
-sprintf( 'order' ); // for translation
13
+sprintf('order'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -69,33 +69,33 @@  discard block
 block discarded – undo
69 69
 		try
70 70
 		{
71 71
 			$total = 0;
72
-			$params = $this->storeSearchParams( $view->param( 'uo', [] ), 'customerorder' );
73
-			$orderItems = $this->getOrderItems( $view->item, $params, $total );
74
-			$baseItems = $this->getOrderBaseItems( $orderItems );
72
+			$params = $this->storeSearchParams($view->param('uo', []), 'customerorder');
73
+			$orderItems = $this->getOrderItems($view->item, $params, $total);
74
+			$baseItems = $this->getOrderBaseItems($orderItems);
75 75
 
76 76
 			$view->orderItems = $orderItems;
77 77
 			$view->orderBaseItems = $baseItems;
78 78
 			$view->orderTotal = $total;
79 79
 			$view->orderBody = '';
80 80
 
81
-			foreach( $this->getSubClients() as $client ) {
81
+			foreach ($this->getSubClients() as $client) {
82 82
 				$view->orderBody .= $client->search();
83 83
 			}
84 84
 		}
85
-		catch( \Aimeos\MShop\Exception $e )
85
+		catch (\Aimeos\MShop\Exception $e)
86 86
 		{
87
-			$error = array( 'customer-order' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
88
-			$view->errors = $view->get( 'errors', [] ) + $error;
89
-			$this->logException( $e );
87
+			$error = array('customer-order' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
88
+			$view->errors = $view->get('errors', []) + $error;
89
+			$this->logException($e);
90 90
 		}
91
-		catch( \Exception $e )
91
+		catch (\Exception $e)
92 92
 		{
93
-			$error = array( 'customer-order' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
94
-			$view->errors = $view->get( 'errors', [] ) + $error;
95
-			$this->logException( $e );
93
+			$error = array('customer-order' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
94
+			$view->errors = $view->get('errors', []) + $error;
95
+			$this->logException($e);
96 96
 		}
97 97
 
98
-		return $this->render( $view );
98
+		return $this->render($view);
99 99
 	}
100 100
 
101 101
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	 * @param string|null $name Name of the sub-client (Default if null)
116 116
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
117 117
 	 */
118
-	public function getSubClient( $type, $name = null )
118
+	public function getSubClient($type, $name = null)
119 119
 	{
120 120
 		/** admin/jqadm/customer/order/decorators/excludes
121 121
 		 * Excludes decorators added by the "common" option from the customer JQAdm client
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 		 * @see admin/jqadm/customer/order/decorators/excludes
191 191
 		 * @see admin/jqadm/customer/order/decorators/global
192 192
 		 */
193
-		return $this->createSubClient( 'customer/order/' . $type, $name );
193
+		return $this->createSubClient('customer/order/' . $type, $name);
194 194
 	}
195 195
 
196 196
 
@@ -200,20 +200,20 @@  discard block
 block discarded – undo
200 200
 	 * @param \Aimeos\MShop\Order\Item\Iface[] $items Order item objects
201 201
 	 * @return \Aimeos\MShop\Order\Item\Base\Iface[] Basket items
202 202
 	 */
203
-	protected function getOrderBaseItems( array $items )
203
+	protected function getOrderBaseItems(array $items)
204 204
 	{
205 205
 		$ids = [];
206 206
 
207
-		foreach( $items as $item ) {
207
+		foreach ($items as $item) {
208 208
 			$ids[] = $item->getBaseId();
209 209
 		}
210 210
 
211
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order/base' );
211
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'order/base');
212 212
 
213
-		$search = $manager->createSearch()->setSlice( 0, count( $ids ) );
214
-		$search->setConditions( $search->compare( '==', 'order.base.id', $ids ) );
213
+		$search = $manager->createSearch()->setSlice(0, count($ids));
214
+		$search->setConditions($search->compare('==', 'order.base.id', $ids));
215 215
 
216
-		return $manager->searchItems( $search );
216
+		return $manager->searchItems($search);
217 217
 	}
218 218
 
219 219
 
@@ -225,21 +225,21 @@  discard block
 block discarded – undo
225 225
 	 * @param integer $total Value/result parameter that will contain the item total afterwards
226 226
 	 * @return \Aimeos\MShop\Order\Item\Iface[] Order items of the customer
227 227
 	 */
228
-	protected function getOrderItems( \Aimeos\MShop\Customer\Item\Iface $item, array $params = [], &$total )
228
+	protected function getOrderItems(\Aimeos\MShop\Customer\Item\Iface $item, array $params = [], &$total)
229 229
 	{
230
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order' );
230
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'order');
231 231
 
232 232
 		$search = $manager->createSearch();
233
-		$search->setSortations( [$search->sort( '-', 'order.ctime' )] );
233
+		$search->setSortations([$search->sort('-', 'order.ctime')]);
234 234
 
235
-		$search = $this->initCriteria( $search, $params );
235
+		$search = $this->initCriteria($search, $params);
236 236
 		$expr = [
237
-			$search->compare( '==', 'order.base.customerid', $item->getId() ),
237
+			$search->compare('==', 'order.base.customerid', $item->getId()),
238 238
 			$search->getConditions(),
239 239
 		];
240
-		$search->setConditions( $search->combine( '&&', $expr ) );
240
+		$search->setConditions($search->combine('&&', $expr));
241 241
 
242
-		return $manager->searchItems( $search, [], $total );
242
+		return $manager->searchItems($search, [], $total);
243 243
 	}
244 244
 
245 245
 
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 		 * @since 2017.07
284 284
 		 * @category Developer
285 285
 		 */
286
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/customer/order/standard/subparts', [] );
286
+		return $this->getContext()->getConfig()->get('admin/jqadm/customer/order/standard/subparts', []);
287 287
 	}
288 288
 
289 289
 
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
294 294
 	 * @return string HTML output
295 295
 	 */
296
-	protected function render( \Aimeos\MW\View\Iface $view )
296
+	protected function render(\Aimeos\MW\View\Iface $view)
297 297
 	{
298 298
 		/** admin/jqadm/customer/order/template-item
299 299
 		 * Relative path to the HTML body template of the order subpart for customers.
@@ -317,6 +317,6 @@  discard block
 block discarded – undo
317 317
 		$tplconf = 'admin/jqadm/customer/order/template-item';
318 318
 		$default = 'customer/item-order-standard.php';
319 319
 
320
-		return $view->render( $view->config( $tplconf, $default ) );
320
+		return $view->render($view->config($tplconf, $default));
321 321
 	}
322 322
 }
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Supplier/Product/Standard.php 2 patches
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -77,14 +77,12 @@  discard block
 block discarded – undo
77 77
 			foreach( $this->getSubClients() as $client ) {
78 78
 				$view->productBody .= $client->copy();
79 79
 			}
80
-		}
81
-		catch( \Aimeos\MShop\Exception $e )
80
+		} catch( \Aimeos\MShop\Exception $e )
82 81
 		{
83 82
 			$error = array( 'supplier-product' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
84 83
 			$view->errors = $view->get( 'errors', [] ) + $error;
85 84
 			$this->logException( $e );
86
-		}
87
-		catch( \Exception $e )
85
+		} catch( \Exception $e )
88 86
 		{
89 87
 			$error = array( 'supplier-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
90 88
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -112,14 +110,12 @@  discard block
 block discarded – undo
112 110
 			foreach( $this->getSubClients() as $client ) {
113 111
 				$view->productBody .= $client->create();
114 112
 			}
115
-		}
116
-		catch( \Aimeos\MShop\Exception $e )
113
+		} catch( \Aimeos\MShop\Exception $e )
117 114
 		{
118 115
 			$error = array( 'supplier-product' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
119 116
 			$view->errors = $view->get( 'errors', [] ) + $error;
120 117
 			$this->logException( $e );
121
-		}
122
-		catch( \Exception $e )
118
+		} catch( \Exception $e )
123 119
 		{
124 120
 			$error = array( 'supplier-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
125 121
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -154,14 +150,12 @@  discard block
 block discarded – undo
154 150
 			foreach( $this->getSubClients() as $client ) {
155 151
 				$view->productBody .= $client->search();
156 152
 			}
157
-		}
158
-		catch( \Aimeos\MShop\Exception $e )
153
+		} catch( \Aimeos\MShop\Exception $e )
159 154
 		{
160 155
 			$error = array( 'supplier-product' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
161 156
 			$view->errors = $view->get( 'errors', [] ) + $error;
162 157
 			$this->logException( $e );
163
-		}
164
-		catch( \Exception $e )
158
+		} catch( \Exception $e )
165 159
 		{
166 160
 			$error = array( 'supplier-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
167 161
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -196,14 +190,12 @@  discard block
 block discarded – undo
196 190
 
197 191
 			$manager->commit();
198 192
 			return;
199
-		}
200
-		catch( \Aimeos\MShop\Exception $e )
193
+		} catch( \Aimeos\MShop\Exception $e )
201 194
 		{
202 195
 			$error = array( 'supplier-item-image' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
203 196
 			$view->errors = $view->get( 'errors', [] ) + $error;
204 197
 			$this->logException( $e );
205
-		}
206
-		catch( \Exception $e )
198
+		} catch( \Exception $e )
207 199
 		{
208 200
 			$error = array( 'supplier-item-image' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
209 201
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 namespace Aimeos\Admin\JQAdm\Supplier\Product;
12 12
 
13
-sprintf( 'product' ); // for translation
13
+sprintf('product'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -49,24 +49,24 @@  discard block
 block discarded – undo
49 49
 			$view->productListTypes = $this->getListTypes();
50 50
 			$view->productBody = '';
51 51
 
52
-			foreach( $this->getSubClients() as $client ) {
52
+			foreach ($this->getSubClients() as $client) {
53 53
 				$view->productBody .= $client->copy();
54 54
 			}
55 55
 		}
56
-		catch( \Aimeos\MShop\Exception $e )
56
+		catch (\Aimeos\MShop\Exception $e)
57 57
 		{
58
-			$error = array( 'supplier-product' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
59
-			$view->errors = $view->get( 'errors', [] ) + $error;
60
-			$this->logException( $e );
58
+			$error = array('supplier-product' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
59
+			$view->errors = $view->get('errors', []) + $error;
60
+			$this->logException($e);
61 61
 		}
62
-		catch( \Exception $e )
62
+		catch (\Exception $e)
63 63
 		{
64
-			$error = array( 'supplier-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
65
-			$view->errors = $view->get( 'errors', [] ) + $error;
66
-			$this->logException( $e );
64
+			$error = array('supplier-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
65
+			$view->errors = $view->get('errors', []) + $error;
66
+			$this->logException($e);
67 67
 		}
68 68
 
69
-		return $this->render( $view );
69
+		return $this->render($view);
70 70
 	}
71 71
 
72 72
 
@@ -84,24 +84,24 @@  discard block
 block discarded – undo
84 84
 			$view->productListTypes = $this->getListTypes();
85 85
 			$view->productBody = '';
86 86
 
87
-			foreach( $this->getSubClients() as $client ) {
87
+			foreach ($this->getSubClients() as $client) {
88 88
 				$view->productBody .= $client->create();
89 89
 			}
90 90
 		}
91
-		catch( \Aimeos\MShop\Exception $e )
91
+		catch (\Aimeos\MShop\Exception $e)
92 92
 		{
93
-			$error = array( 'supplier-product' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
94
-			$view->errors = $view->get( 'errors', [] ) + $error;
95
-			$this->logException( $e );
93
+			$error = array('supplier-product' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
94
+			$view->errors = $view->get('errors', []) + $error;
95
+			$this->logException($e);
96 96
 		}
97
-		catch( \Exception $e )
97
+		catch (\Exception $e)
98 98
 		{
99
-			$error = array( 'supplier-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
100
-			$view->errors = $view->get( 'errors', [] ) + $error;
101
-			$this->logException( $e );
99
+			$error = array('supplier-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
100
+			$view->errors = $view->get('errors', []) + $error;
101
+			$this->logException($e);
102 102
 		}
103 103
 
104
-		return $this->render( $view );
104
+		return $this->render($view);
105 105
 	}
106 106
 
107 107
 
@@ -117,33 +117,33 @@  discard block
 block discarded – undo
117 117
 		try
118 118
 		{
119 119
 			$total = 0;
120
-			$params = $this->storeSearchParams( $view->param( 'sp', [] ), 'supplierproduct' );
121
-			$listItems = $this->getListItems( $view->item, $params, $total );
120
+			$params = $this->storeSearchParams($view->param('sp', []), 'supplierproduct');
121
+			$listItems = $this->getListItems($view->item, $params, $total);
122 122
 
123
-			$view->productItems = $this->getProductItems( $listItems );
124
-			$view->productData = $this->toArray( $listItems );
123
+			$view->productItems = $this->getProductItems($listItems);
124
+			$view->productData = $this->toArray($listItems);
125 125
 			$view->productListTypes = $this->getListTypes();
126 126
 			$view->productTotal = $total;
127 127
 			$view->productBody = '';
128 128
 
129
-			foreach( $this->getSubClients() as $client ) {
129
+			foreach ($this->getSubClients() as $client) {
130 130
 				$view->productBody .= $client->search();
131 131
 			}
132 132
 		}
133
-		catch( \Aimeos\MShop\Exception $e )
133
+		catch (\Aimeos\MShop\Exception $e)
134 134
 		{
135
-			$error = array( 'supplier-product' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
136
-			$view->errors = $view->get( 'errors', [] ) + $error;
137
-			$this->logException( $e );
135
+			$error = array('supplier-product' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
136
+			$view->errors = $view->get('errors', []) + $error;
137
+			$this->logException($e);
138 138
 		}
139
-		catch( \Exception $e )
139
+		catch (\Exception $e)
140 140
 		{
141
-			$error = array( 'supplier-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
142
-			$view->errors = $view->get( 'errors', [] ) + $error;
143
-			$this->logException( $e );
141
+			$error = array('supplier-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
142
+			$view->errors = $view->get('errors', []) + $error;
143
+			$this->logException($e);
144 144
 		}
145 145
 
146
-		return $this->render( $view );
146
+		return $this->render($view);
147 147
 	}
148 148
 
149 149
 
@@ -155,34 +155,34 @@  discard block
 block discarded – undo
155 155
 		$view = $this->getView();
156 156
 		$context = $this->getContext();
157 157
 
158
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'supplier/lists' );
158
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'supplier/lists');
159 159
 
160 160
 		$manager->begin();
161 161
 
162 162
 		try
163 163
 		{
164
-			$this->storeSearchParams( $view->param( 'sp', [] ), 'supplierproduct' );
165
-			$this->fromArray( $view->item, $view->param( 'product', [] ) );
164
+			$this->storeSearchParams($view->param('sp', []), 'supplierproduct');
165
+			$this->fromArray($view->item, $view->param('product', []));
166 166
 			$view->productBody = '';
167 167
 
168
-			foreach( $this->getSubClients() as $client ) {
168
+			foreach ($this->getSubClients() as $client) {
169 169
 				$view->productBody .= $client->save();
170 170
 			}
171 171
 
172 172
 			$manager->commit();
173 173
 			return;
174 174
 		}
175
-		catch( \Aimeos\MShop\Exception $e )
175
+		catch (\Aimeos\MShop\Exception $e)
176 176
 		{
177
-			$error = array( 'supplier-item-image' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
178
-			$view->errors = $view->get( 'errors', [] ) + $error;
179
-			$this->logException( $e );
177
+			$error = array('supplier-item-image' => $context->getI18n()->dt('mshop', $e->getMessage()));
178
+			$view->errors = $view->get('errors', []) + $error;
179
+			$this->logException($e);
180 180
 		}
181
-		catch( \Exception $e )
181
+		catch (\Exception $e)
182 182
 		{
183
-			$error = array( 'supplier-item-image' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
184
-			$view->errors = $view->get( 'errors', [] ) + $error;
185
-			$this->logException( $e );
183
+			$error = array('supplier-item-image' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
184
+			$view->errors = $view->get('errors', []) + $error;
185
+			$this->logException($e);
186 186
 		}
187 187
 
188 188
 		$manager->rollback();
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 	 * @param string|null $name Name of the sub-client (Default if null)
199 199
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
200 200
 	 */
201
-	public function getSubClient( $type, $name = null )
201
+	public function getSubClient($type, $name = null)
202 202
 	{
203 203
 		/** admin/jqadm/supplier/product/decorators/excludes
204 204
 		 * Excludes decorators added by the "common" option from the supplier JQAdm client
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 		 * @see admin/jqadm/supplier/product/decorators/excludes
274 274
 		 * @see admin/jqadm/supplier/product/decorators/global
275 275
 		 */
276
-		return $this->createSubClient( 'supplier/product/' . $type, $name );
276
+		return $this->createSubClient('supplier/product/' . $type, $name);
277 277
 	}
278 278
 
279 279
 
@@ -285,22 +285,22 @@  discard block
 block discarded – undo
285 285
 	 * @param integer $total Value/result parameter that will contain the item total afterwards
286 286
 	 * @return \Aimeos\MShop\Common\Item\List\Iface[] Supplier list items referencing the products
287 287
 	 */
288
-	protected function getListItems( \Aimeos\MShop\Supplier\Item\Iface $item, array $params = [], &$total )
288
+	protected function getListItems(\Aimeos\MShop\Supplier\Item\Iface $item, array $params = [], &$total)
289 289
 	{
290
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'supplier/lists' );
290
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'supplier/lists');
291 291
 
292 292
 		$search = $manager->createSearch();
293
-		$search->setSortations( [$search->sort( '-', 'supplier.lists.ctime' )] );
293
+		$search->setSortations([$search->sort('-', 'supplier.lists.ctime')]);
294 294
 
295
-		$search = $this->initCriteria( $search, $params );
295
+		$search = $this->initCriteria($search, $params);
296 296
 		$expr = [
297 297
 			$search->getConditions(),
298
-			$search->compare( '==', 'supplier.lists.parentid', $item->getId() ),
299
-			$search->compare( '==', 'supplier.lists.domain', 'product' ),
298
+			$search->compare('==', 'supplier.lists.parentid', $item->getId()),
299
+			$search->compare('==', 'supplier.lists.domain', 'product'),
300 300
 		];
301
-		$search->setConditions( $search->combine( '&&', $expr ) );
301
+		$search->setConditions($search->combine('&&', $expr));
302 302
 
303
-		return $manager->searchItems( $search, [], $total );
303
+		return $manager->searchItems($search, [], $total);
304 304
 	}
305 305
 
306 306
 
@@ -312,13 +312,13 @@  discard block
 block discarded – undo
312 312
 	protected function getListTypes()
313 313
 	{
314 314
 		$list = [];
315
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'supplier/lists/type' );
315
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'supplier/lists/type');
316 316
 
317
-		$search = $manager->createSearch()->setSlice( 0, 0x7fffffff );
318
-		$search->setConditions( $search->compare( '==', 'supplier.lists.type.domain', 'product' ) );
319
-		$search->setSortations( [$search->sort( '+', 'supplier.lists.type.code' )] );
317
+		$search = $manager->createSearch()->setSlice(0, 0x7fffffff);
318
+		$search->setConditions($search->compare('==', 'supplier.lists.type.domain', 'product'));
319
+		$search->setSortations([$search->sort('+', 'supplier.lists.type.code')]);
320 320
 
321
-		foreach( $manager->searchItems( $search ) as $id => $item ) {
321
+		foreach ($manager->searchItems($search) as $id => $item) {
322 322
 			$list[$id] = $item->getCode();
323 323
 		}
324 324
 
@@ -332,20 +332,20 @@  discard block
 block discarded – undo
332 332
 	 * @param \Aimeos\MShop\Common\Item\List\Iface[] $listItems Supplier list items referencing the products
333 333
 	 * @return \Aimeos\MShop\Product\Item\Iface[] Associative list of product IDs as keys and items as values
334 334
 	 */
335
-	protected function getProductItems( array $listItems )
335
+	protected function getProductItems(array $listItems)
336 336
 	{
337 337
 		$list = [];
338 338
 
339
-		foreach( $listItems as $listItem ) {
339
+		foreach ($listItems as $listItem) {
340 340
 			$list[] = $listItem->getRefId();
341 341
 		}
342 342
 
343
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product' );
343
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product');
344 344
 
345
-		$search = $manager->createSearch()->setSlice( 0, count( $list ) );
346
-		$search->setConditions( $search->compare( '==', 'product.id', $list ) );
345
+		$search = $manager->createSearch()->setSlice(0, count($list));
346
+		$search->setConditions($search->compare('==', 'product.id', $list));
347 347
 
348
-		return $manager->searchItems( $search );
348
+		return $manager->searchItems($search);
349 349
 	}
350 350
 
351 351
 
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 		 * @since 2017.07
390 390
 		 * @category Developer
391 391
 		 */
392
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/supplier/product/standard/subparts', [] );
392
+		return $this->getContext()->getConfig()->get('admin/jqadm/supplier/product/standard/subparts', []);
393 393
 	}
394 394
 
395 395
 
@@ -399,75 +399,75 @@  discard block
 block discarded – undo
399 399
 	 * @param \Aimeos\MShop\Supplier\Item\Iface $item Supplier item object without referenced domain items
400 400
 	 * @param string[] $data Data array
401 401
 	 */
402
-	protected function fromArray( \Aimeos\MShop\Supplier\Item\Iface $item, array $data )
402
+	protected function fromArray(\Aimeos\MShop\Supplier\Item\Iface $item, array $data)
403 403
 	{
404 404
 		$context = $this->getContext();
405
-		$listIds = $this->getValue( $data, 'supplier.lists.id', [] );
405
+		$listIds = $this->getValue($data, 'supplier.lists.id', []);
406 406
 
407
-		$listManager = \Aimeos\MShop\Factory::createManager( $context, 'supplier/lists' );
407
+		$listManager = \Aimeos\MShop\Factory::createManager($context, 'supplier/lists');
408 408
 
409
-		$search = $listManager->createSearch()->setSlice( 0, count( $listIds ) );
410
-		$search->setConditions( $search->compare( '==', 'supplier.lists.id', $listIds ) );
409
+		$search = $listManager->createSearch()->setSlice(0, count($listIds));
410
+		$search->setConditions($search->compare('==', 'supplier.lists.id', $listIds));
411 411
 
412
-		$listItems = $listManager->searchItems( $search );
412
+		$listItems = $listManager->searchItems($search);
413 413
 
414 414
 
415
-		foreach( (array) $listIds as $idx => $listid )
415
+		foreach ((array) $listIds as $idx => $listid)
416 416
 		{
417
-			if( isset( $listItems[$listid] ) ) {
417
+			if (isset($listItems[$listid])) {
418 418
 				$litem = $listItems[$listid];
419 419
 			} else {
420 420
 				$litem = $listManager->createItem();
421 421
 			}
422 422
 
423
-			$litem->setParentId( $item->getId() );
424
-			$litem->setDomain( 'product' );
423
+			$litem->setParentId($item->getId());
424
+			$litem->setDomain('product');
425 425
 
426
-			if( isset( $data['supplier.lists.refid'][$idx] ) ) {
427
-				$litem->setRefId( $this->getValue( $data, 'supplier.lists.refid/' . $idx ) );
426
+			if (isset($data['supplier.lists.refid'][$idx])) {
427
+				$litem->setRefId($this->getValue($data, 'supplier.lists.refid/' . $idx));
428 428
 			}
429 429
 
430
-			if( isset( $data['supplier.lists.status'][$idx] ) ) {
431
-				$litem->setStatus( $this->getValue( $data, 'supplier.lists.status/' . $idx ) );
430
+			if (isset($data['supplier.lists.status'][$idx])) {
431
+				$litem->setStatus($this->getValue($data, 'supplier.lists.status/' . $idx));
432 432
 			}
433 433
 
434
-			if( isset( $data['supplier.lists.typeid'][$idx] ) ) {
435
-				$litem->setTypeId( $this->getValue( $data, 'supplier.lists.typeid/' . $idx ) );
434
+			if (isset($data['supplier.lists.typeid'][$idx])) {
435
+				$litem->setTypeId($this->getValue($data, 'supplier.lists.typeid/' . $idx));
436 436
 			}
437 437
 
438
-			if( isset( $data['supplier.lists.position'][$idx] ) ) {
439
-				$litem->setPosition( $this->getValue( $data, 'supplier.lists.position/' . $idx ) );
438
+			if (isset($data['supplier.lists.position'][$idx])) {
439
+				$litem->setPosition($this->getValue($data, 'supplier.lists.position/' . $idx));
440 440
 			}
441 441
 
442
-			if( isset( $data['supplier.lists.datestart'][$idx] ) ) {
443
-				$litem->setDateStart( $this->getValue( $data, 'supplier.lists.datestart/' . $idx ) );
442
+			if (isset($data['supplier.lists.datestart'][$idx])) {
443
+				$litem->setDateStart($this->getValue($data, 'supplier.lists.datestart/' . $idx));
444 444
 			}
445 445
 
446
-			if( isset( $data['supplier.lists.dateend'][$idx] ) ) {
447
-				$litem->setDateEnd( $this->getValue( $data, 'supplier.lists.dateend/' . $idx ) );
446
+			if (isset($data['supplier.lists.dateend'][$idx])) {
447
+				$litem->setDateEnd($this->getValue($data, 'supplier.lists.dateend/' . $idx));
448 448
 			}
449 449
 
450
-			if( isset( $data['supplier.lists.config'][$idx] )
451
-				&& ( $conf = json_decode( $this->getValue( $data, 'supplier.lists.config/' . $idx ), true ) ) !== null
450
+			if (isset($data['supplier.lists.config'][$idx])
451
+				&& ($conf = json_decode($this->getValue($data, 'supplier.lists.config/' . $idx), true)) !== null
452 452
 			) {
453
-				$litem->setConfig( $conf );
453
+				$litem->setConfig($conf);
454 454
 			}
455 455
 
456
-			if( $litem->getId() === null && isset( $data['config'][$idx]['key'] ) )
456
+			if ($litem->getId() === null && isset($data['config'][$idx]['key']))
457 457
 			{
458 458
 				$conf = [];
459 459
 
460
-				foreach( (array) $data['config'][$idx]['key'] as $pos => $key )
460
+				foreach ((array) $data['config'][$idx]['key'] as $pos => $key)
461 461
 				{
462
-					if( trim( $key ) !== '' && isset( $data['config'][$idx]['val'][$pos] ) ) {
462
+					if (trim($key) !== '' && isset($data['config'][$idx]['val'][$pos])) {
463 463
 						$conf[$key] = $data['config'][$idx]['val'][$pos];
464 464
 					}
465 465
 				}
466 466
 
467
-				$litem->setConfig( $conf );
467
+				$litem->setConfig($conf);
468 468
 			}
469 469
 
470
-			$listManager->saveItem( $litem, false );
470
+			$listManager->saveItem($litem, false);
471 471
 		}
472 472
 	}
473 473
 
@@ -478,13 +478,13 @@  discard block
 block discarded – undo
478 478
 	 * @param \Aimeos\MShop\Common\Item\Lists\Iface[] $listItems Supplier list items referencing the products
479 479
 	 * @return string[] Multi-dimensional associative list of item data
480 480
 	 */
481
-	protected function toArray( array $listItems )
481
+	protected function toArray(array $listItems)
482 482
 	{
483 483
 		$data = [];
484 484
 
485
-		foreach( $listItems as $listItem )
485
+		foreach ($listItems as $listItem)
486 486
 		{
487
-			foreach( $listItem->toArray( true ) as $key => $value ) {
487
+			foreach ($listItem->toArray(true) as $key => $value) {
488 488
 				$data[$key][] = $value;
489 489
 			}
490 490
 		}
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
500 500
 	 * @return string HTML output
501 501
 	 */
502
-	protected function render( \Aimeos\MW\View\Iface $view )
502
+	protected function render(\Aimeos\MW\View\Iface $view)
503 503
 	{
504 504
 		/** admin/jqadm/supplier/product/template-item
505 505
 		 * Relative path to the HTML body template of the product subpart for suppliers.
@@ -523,6 +523,6 @@  discard block
 block discarded – undo
523 523
 		$tplconf = 'admin/jqadm/supplier/product/template-item';
524 524
 		$default = 'supplier/item-product-standard.php';
525 525
 
526
-		return $view->render( $view->config( $tplconf, $default ) );
526
+		return $view->render($view->config($tplconf, $default));
527 527
 	}
528 528
 }
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Coupon/Code/Standard.php 2 patches
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -104,14 +104,12 @@  discard block
 block discarded – undo
104 104
 			foreach( $this->getSubClients() as $client ) {
105 105
 				$view->codeBody .= $client->search();
106 106
 			}
107
-		}
108
-		catch( \Aimeos\MShop\Exception $e )
107
+		} catch( \Aimeos\MShop\Exception $e )
109 108
 		{
110 109
 			$error = array( 'coupon-item-code' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
111 110
 			$view->errors = $view->get( 'errors', [] ) + $error;
112 111
 			$this->logException( $e );
113
-		}
114
-		catch( \Exception $e )
112
+		} catch( \Exception $e )
115 113
 		{
116 114
 			$error = array( 'coupon-item-code' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
117 115
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -146,14 +144,12 @@  discard block
 block discarded – undo
146 144
 
147 145
 			$manager->commit();
148 146
 			return;
149
-		}
150
-		catch( \Aimeos\MShop\Exception $e )
147
+		} catch( \Aimeos\MShop\Exception $e )
151 148
 		{
152 149
 			$error = array( 'coupon-item-code' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
153 150
 			$view->errors = $view->get( 'errors', [] ) + $error;
154 151
 			$this->logException( $e );
155
-		}
156
-		catch( \Exception $e )
152
+		} catch( \Exception $e )
157 153
 		{
158 154
 			$error = array( 'coupon-item-code' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
159 155
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 namespace Aimeos\Admin\JQAdm\Coupon\Code;
12 12
 
13
-sprintf( 'code' ); // for translation
13
+sprintf('code'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 */
43 43
 	public function copy()
44 44
 	{
45
-		return $this->render( $this->getView() );
45
+		return $this->render($this->getView());
46 46
 	}
47 47
 
48 48
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 */
54 54
 	public function create()
55 55
 	{
56
-		return $this->render( $this->getView() );
56
+		return $this->render($this->getView());
57 57
 	}
58 58
 
59 59
 
@@ -69,31 +69,31 @@  discard block
 block discarded – undo
69 69
 		try
70 70
 		{
71 71
 			$total = 0;
72
-			$params = $this->storeSearchParams( $view->param( 'vc', [] ), 'couponcode' );
73
-			$codeItems = $this->getCodeItems( $view->item, $params, $total );
72
+			$params = $this->storeSearchParams($view->param('vc', []), 'couponcode');
73
+			$codeItems = $this->getCodeItems($view->item, $params, $total);
74 74
 
75
-			$view->codeData = $this->toArray( $codeItems );
75
+			$view->codeData = $this->toArray($codeItems);
76 76
 			$view->codeTotal = $total;
77 77
 			$view->codeBody = '';
78 78
 
79
-			foreach( $this->getSubClients() as $client ) {
79
+			foreach ($this->getSubClients() as $client) {
80 80
 				$view->codeBody .= $client->search();
81 81
 			}
82 82
 		}
83
-		catch( \Aimeos\MShop\Exception $e )
83
+		catch (\Aimeos\MShop\Exception $e)
84 84
 		{
85
-			$error = array( 'coupon-item-code' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
86
-			$view->errors = $view->get( 'errors', [] ) + $error;
87
-			$this->logException( $e );
85
+			$error = array('coupon-item-code' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
86
+			$view->errors = $view->get('errors', []) + $error;
87
+			$this->logException($e);
88 88
 		}
89
-		catch( \Exception $e )
89
+		catch (\Exception $e)
90 90
 		{
91
-			$error = array( 'coupon-item-code' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
92
-			$view->errors = $view->get( 'errors', [] ) + $error;
93
-			$this->logException( $e );
91
+			$error = array('coupon-item-code' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
92
+			$view->errors = $view->get('errors', []) + $error;
93
+			$this->logException($e);
94 94
 		}
95 95
 
96
-		return $this->render( $view );
96
+		return $this->render($view);
97 97
 	}
98 98
 
99 99
 
@@ -105,34 +105,34 @@  discard block
 block discarded – undo
105 105
 		$view = $this->getView();
106 106
 		$context = $this->getContext();
107 107
 
108
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'coupon/code' );
108
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'coupon/code');
109 109
 		$manager->begin();
110 110
 
111 111
 		try
112 112
 		{
113
-			$this->storeSearchParams( $view->param( 'vc', [] ), 'couponcode' );
114
-			$this->storeFile( $view->item, (array) $view->request()->getUploadedFiles() );
115
-			$this->fromArray( $view->item, $view->param( 'code', [] ) );
113
+			$this->storeSearchParams($view->param('vc', []), 'couponcode');
114
+			$this->storeFile($view->item, (array) $view->request()->getUploadedFiles());
115
+			$this->fromArray($view->item, $view->param('code', []));
116 116
 			$view->couponBody = '';
117 117
 
118
-			foreach( $this->getSubClients() as $client ) {
118
+			foreach ($this->getSubClients() as $client) {
119 119
 				$view->couponBody .= $client->save();
120 120
 			}
121 121
 
122 122
 			$manager->commit();
123 123
 			return;
124 124
 		}
125
-		catch( \Aimeos\MShop\Exception $e )
125
+		catch (\Aimeos\MShop\Exception $e)
126 126
 		{
127
-			$error = array( 'coupon-item-code' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
128
-			$view->errors = $view->get( 'errors', [] ) + $error;
129
-			$this->logException( $e );
127
+			$error = array('coupon-item-code' => $context->getI18n()->dt('mshop', $e->getMessage()));
128
+			$view->errors = $view->get('errors', []) + $error;
129
+			$this->logException($e);
130 130
 		}
131
-		catch( \Exception $e )
131
+		catch (\Exception $e)
132 132
 		{
133
-			$error = array( 'coupon-item-code' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
134
-			$view->errors = $view->get( 'errors', [] ) + $error;
135
-			$this->logException( $e );
133
+			$error = array('coupon-item-code' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
134
+			$view->errors = $view->get('errors', []) + $error;
135
+			$this->logException($e);
136 136
 		}
137 137
 
138 138
 		$manager->rollback();
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	 * @param string|null $name Name of the sub-client (Default if null)
149 149
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
150 150
 	 */
151
-	public function getSubClient( $type, $name = null )
151
+	public function getSubClient($type, $name = null)
152 152
 	{
153 153
 		/** admin/jqadm/coupon/code/decorators/excludes
154 154
 		 * Excludes decorators added by the "common" option from the coupon JQAdm client
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 		 * @see admin/jqadm/coupon/code/decorators/excludes
224 224
 		 * @see admin/jqadm/coupon/code/decorators/global
225 225
 		 */
226
-		return $this->createSubClient( 'coupon/code/' . $type, $name );
226
+		return $this->createSubClient('coupon/code/' . $type, $name);
227 227
 	}
228 228
 
229 229
 
@@ -233,27 +233,27 @@  discard block
 block discarded – undo
233 233
 	 * @param \Psr\Http\Message\UploadedFileInterface $file Uploaded file
234 234
 	 * @throws \Aimeos\Admin\JQAdm\Exception If an error occured during upload
235 235
 	 */
236
-	protected function checkFileUpload( \Psr\Http\Message\UploadedFileInterface $file )
236
+	protected function checkFileUpload(\Psr\Http\Message\UploadedFileInterface $file)
237 237
 	{
238
-		if( $file->getError() !== UPLOAD_ERR_OK )
238
+		if ($file->getError() !== UPLOAD_ERR_OK)
239 239
 		{
240
-			switch( $file->getError() )
240
+			switch ($file->getError())
241 241
 			{
242 242
 				case UPLOAD_ERR_INI_SIZE:
243 243
 				case UPLOAD_ERR_FORM_SIZE:
244
-					throw new \Aimeos\Admin\JQAdm\Exception( 'The uploaded file exceeds the max. allowed filesize' );
244
+					throw new \Aimeos\Admin\JQAdm\Exception('The uploaded file exceeds the max. allowed filesize');
245 245
 				case UPLOAD_ERR_PARTIAL:
246
-					throw new \Aimeos\Admin\JQAdm\Exception( 'The uploaded file was only partially uploaded' );
246
+					throw new \Aimeos\Admin\JQAdm\Exception('The uploaded file was only partially uploaded');
247 247
 				case UPLOAD_ERR_NO_FILE:
248
-					throw new \Aimeos\Admin\JQAdm\Exception( 'No file was uploaded' );
248
+					throw new \Aimeos\Admin\JQAdm\Exception('No file was uploaded');
249 249
 				case UPLOAD_ERR_NO_TMP_DIR:
250
-					throw new \Aimeos\Admin\JQAdm\Exception( 'Temporary folder is missing' );
250
+					throw new \Aimeos\Admin\JQAdm\Exception('Temporary folder is missing');
251 251
 				case UPLOAD_ERR_CANT_WRITE:
252
-					throw new \Aimeos\Admin\JQAdm\Exception( 'Failed to write file to disk' );
252
+					throw new \Aimeos\Admin\JQAdm\Exception('Failed to write file to disk');
253 253
 				case UPLOAD_ERR_EXTENSION:
254
-					throw new \Aimeos\Admin\JQAdm\Exception( 'File upload stopped by extension' );
254
+					throw new \Aimeos\Admin\JQAdm\Exception('File upload stopped by extension');
255 255
 				default:
256
-					throw new \Aimeos\Admin\JQAdm\Exception( 'Unknown upload error' );
256
+					throw new \Aimeos\Admin\JQAdm\Exception('Unknown upload error');
257 257
 			}
258 258
 		}
259 259
 	}
@@ -267,21 +267,21 @@  discard block
 block discarded – undo
267 267
 	 * @param integer $total Value/result parameter that will contain the item total afterwards
268 268
 	 * @return \Aimeos\MShop\Coupon\Item\Code\Iface[] Coupon code items associated to the coupon item
269 269
 	 */
270
-	protected function getCodeItems( \Aimeos\MShop\Coupon\Item\Iface $item, array $params = [], &$total )
270
+	protected function getCodeItems(\Aimeos\MShop\Coupon\Item\Iface $item, array $params = [], &$total)
271 271
 	{
272
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'coupon/code' );
272
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'coupon/code');
273 273
 
274 274
 		$search = $manager->createSearch();
275
-		$search->setSortations( [$search->sort( '+', 'coupon.code.code' )] );
275
+		$search->setSortations([$search->sort('+', 'coupon.code.code')]);
276 276
 
277
-		$search = $this->initCriteria( $search, $params );
277
+		$search = $this->initCriteria($search, $params);
278 278
 		$expr = [
279
-			$search->compare( '==', 'coupon.code.parentid', $item->getId() ),
279
+			$search->compare('==', 'coupon.code.parentid', $item->getId()),
280 280
 			$search->getConditions(),
281 281
 		];
282
-		$search->setConditions( $search->combine( '&&', $expr ) );
282
+		$search->setConditions($search->combine('&&', $expr));
283 283
 
284
-		return $manager->searchItems( $search, [], $total );
284
+		return $manager->searchItems($search, [], $total);
285 285
 	}
286 286
 
287 287
 
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 		 * @since 2017.07
326 326
 		 * @category Developer
327 327
 		 */
328
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/coupon/code/standard/subparts', [] );
328
+		return $this->getContext()->getConfig()->get('admin/jqadm/coupon/code/standard/subparts', []);
329 329
 	}
330 330
 
331 331
 
@@ -335,22 +335,22 @@  discard block
 block discarded – undo
335 335
 	 * @param \Aimeos\MShop\Coupon\Item\Iface $item Coupon item object
336 336
 	 * @param string[] $data Data array
337 337
 	 */
338
-	protected function fromArray( \Aimeos\MShop\Coupon\Item\Iface $item, array $data )
338
+	protected function fromArray(\Aimeos\MShop\Coupon\Item\Iface $item, array $data)
339 339
 	{
340
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'coupon/code' );
340
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'coupon/code');
341 341
 
342
-		foreach( $this->getValue( $data, 'coupon.code.id', [] ) as $idx => $id )
342
+		foreach ($this->getValue($data, 'coupon.code.id', []) as $idx => $id)
343 343
 		{
344 344
 			$citem = $manager->createItem();
345 345
 
346
-			$citem->setId( $id );
347
-			$citem->setParentId( $item->getId() );
348
-			$citem->setCode( $this->getValue( $data, 'coupon.code.code/' . $idx ) );
349
-			$citem->setCount( $this->getValue( $data, 'coupon.code.count/' . $idx ) );
350
-			$citem->setDateStart( $this->getValue( $data, 'coupon.code.datestart/' . $idx ) );
351
-			$citem->setDateEnd( $this->getValue( $data, 'coupon.code.dateend/' . $idx ) );
346
+			$citem->setId($id);
347
+			$citem->setParentId($item->getId());
348
+			$citem->setCode($this->getValue($data, 'coupon.code.code/' . $idx));
349
+			$citem->setCount($this->getValue($data, 'coupon.code.count/' . $idx));
350
+			$citem->setDateStart($this->getValue($data, 'coupon.code.datestart/' . $idx));
351
+			$citem->setDateEnd($this->getValue($data, 'coupon.code.dateend/' . $idx));
352 352
 
353
-			$manager->saveItem( $citem, false );
353
+			$manager->saveItem($citem, false);
354 354
 		}
355 355
 	}
356 356
 
@@ -361,25 +361,25 @@  discard block
 block discarded – undo
361 361
 	 * @param \Aimeos\MShop\Coupon\Item\Iface $item Coupon item object
362 362
 	 * @param array $files File upload array including the PSR-7 file upload objects
363 363
 	 */
364
-	protected function storeFile( \Aimeos\MShop\Coupon\Item\Iface $item, array $files )
364
+	protected function storeFile(\Aimeos\MShop\Coupon\Item\Iface $item, array $files)
365 365
 	{
366
-		$file = $this->getValue( $files, 'code/file' );
366
+		$file = $this->getValue($files, 'code/file');
367 367
 
368
-		if( $file == null || $file->getError() === UPLOAD_ERR_NO_FILE ) {
368
+		if ($file == null || $file->getError() === UPLOAD_ERR_NO_FILE) {
369 369
 			return;
370 370
 		}
371 371
 
372
-		$this->checkFileUpload( $file );
372
+		$this->checkFileUpload($file);
373 373
 
374 374
 		$context = $this->getContext();
375
-		$fs = $context->getFilesystemManager()->get( 'fs-import' );
375
+		$fs = $context->getFilesystemManager()->get('fs-import');
376 376
 		$dir = 'couponcode/' . $context->getLocale()->getSite()->getCode();
377 377
 
378
-		if( $fs->isdir( $dir ) === false ) {
379
-			$fs->mkdir( $dir );
378
+		if ($fs->isdir($dir) === false) {
379
+			$fs->mkdir($dir);
380 380
 		}
381 381
 
382
-		$fs->writes( $dir . '/' . $item->getId() . '.csv', $file->getStream()->detach() );
382
+		$fs->writes($dir . '/' . $item->getId() . '.csv', $file->getStream()->detach());
383 383
 	}
384 384
 
385 385
 
@@ -389,13 +389,13 @@  discard block
 block discarded – undo
389 389
 	 * @param \Aimeos\MShop\Coupon\Item\Code\Iface[] $items Coupon code items
390 390
 	 * @return string[] Multi-dimensional associative list of item data
391 391
 	 */
392
-	protected function toArray( array $items )
392
+	protected function toArray(array $items)
393 393
 	{
394 394
 		$data = [];
395 395
 
396
-		foreach( $items as $item )
396
+		foreach ($items as $item)
397 397
 		{
398
-			foreach( $item->toArray( true ) as $key => $value ) {
398
+			foreach ($item->toArray(true) as $key => $value) {
399 399
 				$data[$key][] = $value;
400 400
 			}
401 401
 		}
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
411 411
 	 * @return string HTML output
412 412
 	 */
413
-	protected function render( \Aimeos\MW\View\Iface $view )
413
+	protected function render(\Aimeos\MW\View\Iface $view)
414 414
 	{
415 415
 		/** admin/jqadm/coupon/code/template-item
416 416
 		 * Relative path to the HTML body template of the code subpart for coupons.
@@ -434,6 +434,6 @@  discard block
 block discarded – undo
434 434
 		$tplconf = 'admin/jqadm/coupon/code/template-item';
435 435
 		$default = 'coupon/item-code-standard.php';
436 436
 
437
-		return $view->render( $view->config( $tplconf, $default ) );
437
+		return $view->render($view->config($tplconf, $default));
438 438
 	}
439 439
 }
Please login to merge, or discard this patch.
admin/jqadm/src/Admin/JQAdm/Catalog/Product/Standard.php 2 patches
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -77,14 +77,12 @@  discard block
 block discarded – undo
77 77
 			foreach( $this->getSubClients() as $client ) {
78 78
 				$view->productBody .= $client->copy();
79 79
 			}
80
-		}
81
-		catch( \Aimeos\MShop\Exception $e )
80
+		} catch( \Aimeos\MShop\Exception $e )
82 81
 		{
83 82
 			$error = array( 'catalog-product' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
84 83
 			$view->errors = $view->get( 'errors', [] ) + $error;
85 84
 			$this->logException( $e );
86
-		}
87
-		catch( \Exception $e )
85
+		} catch( \Exception $e )
88 86
 		{
89 87
 			$error = array( 'catalog-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
90 88
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -112,14 +110,12 @@  discard block
 block discarded – undo
112 110
 			foreach( $this->getSubClients() as $client ) {
113 111
 				$view->productBody .= $client->create();
114 112
 			}
115
-		}
116
-		catch( \Aimeos\MShop\Exception $e )
113
+		} catch( \Aimeos\MShop\Exception $e )
117 114
 		{
118 115
 			$error = array( 'catalog-product' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
119 116
 			$view->errors = $view->get( 'errors', [] ) + $error;
120 117
 			$this->logException( $e );
121
-		}
122
-		catch( \Exception $e )
118
+		} catch( \Exception $e )
123 119
 		{
124 120
 			$error = array( 'catalog-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
125 121
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -154,14 +150,12 @@  discard block
 block discarded – undo
154 150
 			foreach( $this->getSubClients() as $client ) {
155 151
 				$view->productBody .= $client->get();
156 152
 			}
157
-		}
158
-		catch( \Aimeos\MShop\Exception $e )
153
+		} catch( \Aimeos\MShop\Exception $e )
159 154
 		{
160 155
 			$error = array( 'catalog-product' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
161 156
 			$view->errors = $view->get( 'errors', [] ) + $error;
162 157
 			$this->logException( $e );
163
-		}
164
-		catch( \Exception $e )
158
+		} catch( \Exception $e )
165 159
 		{
166 160
 			$error = array( 'catalog-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
167 161
 			$view->errors = $view->get( 'errors', [] ) + $error;
@@ -196,14 +190,12 @@  discard block
 block discarded – undo
196 190
 
197 191
 			$manager->commit();
198 192
 			return;
199
-		}
200
-		catch( \Aimeos\MShop\Exception $e )
193
+		} catch( \Aimeos\MShop\Exception $e )
201 194
 		{
202 195
 			$error = array( 'catalog-item-image' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
203 196
 			$view->errors = $view->get( 'errors', [] ) + $error;
204 197
 			$this->logException( $e );
205
-		}
206
-		catch( \Exception $e )
198
+		} catch( \Exception $e )
207 199
 		{
208 200
 			$error = array( 'catalog-item-image' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
209 201
 			$view->errors = $view->get( 'errors', [] ) + $error;
Please login to merge, or discard this patch.
Spacing   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 namespace Aimeos\Admin\JQAdm\Catalog\Product;
12 12
 
13
-sprintf( 'product' ); // for translation
13
+sprintf('product'); // for translation
14 14
 
15 15
 
16 16
 /**
@@ -49,24 +49,24 @@  discard block
 block discarded – undo
49 49
 			$view->productListTypes = $this->getListTypes();
50 50
 			$view->productBody = '';
51 51
 
52
-			foreach( $this->getSubClients() as $client ) {
52
+			foreach ($this->getSubClients() as $client) {
53 53
 				$view->productBody .= $client->copy();
54 54
 			}
55 55
 		}
56
-		catch( \Aimeos\MShop\Exception $e )
56
+		catch (\Aimeos\MShop\Exception $e)
57 57
 		{
58
-			$error = array( 'catalog-product' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
59
-			$view->errors = $view->get( 'errors', [] ) + $error;
60
-			$this->logException( $e );
58
+			$error = array('catalog-product' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
59
+			$view->errors = $view->get('errors', []) + $error;
60
+			$this->logException($e);
61 61
 		}
62
-		catch( \Exception $e )
62
+		catch (\Exception $e)
63 63
 		{
64
-			$error = array( 'catalog-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
65
-			$view->errors = $view->get( 'errors', [] ) + $error;
66
-			$this->logException( $e );
64
+			$error = array('catalog-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
65
+			$view->errors = $view->get('errors', []) + $error;
66
+			$this->logException($e);
67 67
 		}
68 68
 
69
-		return $this->render( $view );
69
+		return $this->render($view);
70 70
 	}
71 71
 
72 72
 
@@ -84,24 +84,24 @@  discard block
 block discarded – undo
84 84
 			$view->productListTypes = $this->getListTypes();
85 85
 			$view->productBody = '';
86 86
 
87
-			foreach( $this->getSubClients() as $client ) {
87
+			foreach ($this->getSubClients() as $client) {
88 88
 				$view->productBody .= $client->create();
89 89
 			}
90 90
 		}
91
-		catch( \Aimeos\MShop\Exception $e )
91
+		catch (\Aimeos\MShop\Exception $e)
92 92
 		{
93
-			$error = array( 'catalog-product' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
94
-			$view->errors = $view->get( 'errors', [] ) + $error;
95
-			$this->logException( $e );
93
+			$error = array('catalog-product' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
94
+			$view->errors = $view->get('errors', []) + $error;
95
+			$this->logException($e);
96 96
 		}
97
-		catch( \Exception $e )
97
+		catch (\Exception $e)
98 98
 		{
99
-			$error = array( 'catalog-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
100
-			$view->errors = $view->get( 'errors', [] ) + $error;
101
-			$this->logException( $e );
99
+			$error = array('catalog-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
100
+			$view->errors = $view->get('errors', []) + $error;
101
+			$this->logException($e);
102 102
 		}
103 103
 
104
-		return $this->render( $view );
104
+		return $this->render($view);
105 105
 	}
106 106
 
107 107
 
@@ -117,33 +117,33 @@  discard block
 block discarded – undo
117 117
 		try
118 118
 		{
119 119
 			$total = 0;
120
-			$params = $this->storeSearchParams( $view->param( 'cp', [] ), 'catalogproduct' );
121
-			$listItems = $this->getListItems( $view->item, $params, $total );
120
+			$params = $this->storeSearchParams($view->param('cp', []), 'catalogproduct');
121
+			$listItems = $this->getListItems($view->item, $params, $total);
122 122
 
123
-			$view->productItems = $this->getProductItems( $listItems );
124
-			$view->productData = $this->toArray( $listItems );
123
+			$view->productItems = $this->getProductItems($listItems);
124
+			$view->productData = $this->toArray($listItems);
125 125
 			$view->productListTypes = $this->getListTypes();
126 126
 			$view->productTotal = $total;
127 127
 			$view->productBody = '';
128 128
 
129
-			foreach( $this->getSubClients() as $client ) {
129
+			foreach ($this->getSubClients() as $client) {
130 130
 				$view->productBody .= $client->get();
131 131
 			}
132 132
 		}
133
-		catch( \Aimeos\MShop\Exception $e )
133
+		catch (\Aimeos\MShop\Exception $e)
134 134
 		{
135
-			$error = array( 'catalog-product' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
136
-			$view->errors = $view->get( 'errors', [] ) + $error;
137
-			$this->logException( $e );
135
+			$error = array('catalog-product' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage()));
136
+			$view->errors = $view->get('errors', []) + $error;
137
+			$this->logException($e);
138 138
 		}
139
-		catch( \Exception $e )
139
+		catch (\Exception $e)
140 140
 		{
141
-			$error = array( 'catalog-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
142
-			$view->errors = $view->get( 'errors', [] ) + $error;
143
-			$this->logException( $e );
141
+			$error = array('catalog-product' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
142
+			$view->errors = $view->get('errors', []) + $error;
143
+			$this->logException($e);
144 144
 		}
145 145
 
146
-		return $this->render( $view );
146
+		return $this->render($view);
147 147
 	}
148 148
 
149 149
 
@@ -155,34 +155,34 @@  discard block
 block discarded – undo
155 155
 		$view = $this->getView();
156 156
 		$context = $this->getContext();
157 157
 
158
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'catalog/lists' );
158
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'catalog/lists');
159 159
 
160 160
 		$manager->begin();
161 161
 
162 162
 		try
163 163
 		{
164
-			$this->storeSearchParams( $view->param( 'cp', [] ), 'catalogproduct' );
165
-			$this->fromArray( $view->item, $view->param( 'product', [] ) );
164
+			$this->storeSearchParams($view->param('cp', []), 'catalogproduct');
165
+			$this->fromArray($view->item, $view->param('product', []));
166 166
 			$view->productBody = '';
167 167
 
168
-			foreach( $this->getSubClients() as $client ) {
168
+			foreach ($this->getSubClients() as $client) {
169 169
 				$view->productBody .= $client->save();
170 170
 			}
171 171
 
172 172
 			$manager->commit();
173 173
 			return;
174 174
 		}
175
-		catch( \Aimeos\MShop\Exception $e )
175
+		catch (\Aimeos\MShop\Exception $e)
176 176
 		{
177
-			$error = array( 'catalog-item-image' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
178
-			$view->errors = $view->get( 'errors', [] ) + $error;
179
-			$this->logException( $e );
177
+			$error = array('catalog-item-image' => $context->getI18n()->dt('mshop', $e->getMessage()));
178
+			$view->errors = $view->get('errors', []) + $error;
179
+			$this->logException($e);
180 180
 		}
181
-		catch( \Exception $e )
181
+		catch (\Exception $e)
182 182
 		{
183
-			$error = array( 'catalog-item-image' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
184
-			$view->errors = $view->get( 'errors', [] ) + $error;
185
-			$this->logException( $e );
183
+			$error = array('catalog-item-image' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine());
184
+			$view->errors = $view->get('errors', []) + $error;
185
+			$this->logException($e);
186 186
 		}
187 187
 
188 188
 		$manager->rollback();
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 	 * @param string|null $name Name of the sub-client (Default if null)
199 199
 	 * @return \Aimeos\Admin\JQAdm\Iface Sub-client object
200 200
 	 */
201
-	public function getSubClient( $type, $name = null )
201
+	public function getSubClient($type, $name = null)
202 202
 	{
203 203
 		/** admin/jqadm/catalog/product/decorators/excludes
204 204
 		 * Excludes decorators added by the "common" option from the catalog JQAdm client
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 		 * @see admin/jqadm/catalog/product/decorators/excludes
274 274
 		 * @see admin/jqadm/catalog/product/decorators/global
275 275
 		 */
276
-		return $this->createSubClient( 'catalog/product/' . $type, $name );
276
+		return $this->createSubClient('catalog/product/' . $type, $name);
277 277
 	}
278 278
 
279 279
 
@@ -285,22 +285,22 @@  discard block
 block discarded – undo
285 285
 	 * @param integer $total Value/result parameter that will contain the item total afterwards
286 286
 	 * @return \Aimeos\MShop\Common\Item\List\Iface[] Catalog list items referencing the products
287 287
 	 */
288
-	protected function getListItems( \Aimeos\MShop\Catalog\Item\Iface $item, array $params = [], &$total )
288
+	protected function getListItems(\Aimeos\MShop\Catalog\Item\Iface $item, array $params = [], &$total)
289 289
 	{
290
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'catalog/lists' );
290
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'catalog/lists');
291 291
 
292 292
 		$search = $manager->createSearch();
293
-		$search->setSortations( [$search->sort( '+', 'catalog.lists.position' )] );
293
+		$search->setSortations([$search->sort('+', 'catalog.lists.position')]);
294 294
 
295
-		$search = $this->initCriteria( $search, $params, 'catalogproduct' );
295
+		$search = $this->initCriteria($search, $params, 'catalogproduct');
296 296
 		$expr = [
297 297
 			$search->getConditions(),
298
-			$search->compare( '==', 'catalog.lists.parentid', $item->getId() ),
299
-			$search->compare( '==', 'catalog.lists.domain', 'product' ),
298
+			$search->compare('==', 'catalog.lists.parentid', $item->getId()),
299
+			$search->compare('==', 'catalog.lists.domain', 'product'),
300 300
 		];
301
-		$search->setConditions( $search->combine( '&&', $expr ) );
301
+		$search->setConditions($search->combine('&&', $expr));
302 302
 
303
-		return $manager->searchItems( $search, [], $total );
303
+		return $manager->searchItems($search, [], $total);
304 304
 	}
305 305
 
306 306
 
@@ -312,13 +312,13 @@  discard block
 block discarded – undo
312 312
 	protected function getListTypes()
313 313
 	{
314 314
 		$list = [];
315
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'catalog/lists/type' );
315
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'catalog/lists/type');
316 316
 
317
-		$search = $manager->createSearch()->setSlice( 0, 0x7fffffff );
318
-		$search->setConditions( $search->compare( '==', 'catalog.lists.type.domain', 'product' ) );
319
-		$search->setSortations( [$search->sort( '+', 'catalog.lists.type.code' )] );
317
+		$search = $manager->createSearch()->setSlice(0, 0x7fffffff);
318
+		$search->setConditions($search->compare('==', 'catalog.lists.type.domain', 'product'));
319
+		$search->setSortations([$search->sort('+', 'catalog.lists.type.code')]);
320 320
 
321
-		foreach( $manager->searchItems( $search ) as $id => $item ) {
321
+		foreach ($manager->searchItems($search) as $id => $item) {
322 322
 			$list[$id] = $item->getCode();
323 323
 		}
324 324
 
@@ -332,20 +332,20 @@  discard block
 block discarded – undo
332 332
 	 * @param \Aimeos\MShop\Common\Item\List\Iface[] $listItems Catalog list items referencing the products
333 333
 	 * @return \Aimeos\MShop\Product\Item\Iface[] Associative list of product IDs as keys and items as values
334 334
 	 */
335
-	protected function getProductItems( array $listItems )
335
+	protected function getProductItems(array $listItems)
336 336
 	{
337 337
 		$list = [];
338 338
 
339
-		foreach( $listItems as $listItem ) {
339
+		foreach ($listItems as $listItem) {
340 340
 			$list[] = $listItem->getRefId();
341 341
 		}
342 342
 
343
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product' );
343
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product');
344 344
 
345
-		$search = $manager->createSearch()->setSlice( 0, count( $list ) );
346
-		$search->setConditions( $search->compare( '==', 'product.id', $list ) );
345
+		$search = $manager->createSearch()->setSlice(0, count($list));
346
+		$search->setConditions($search->compare('==', 'product.id', $list));
347 347
 
348
-		return $manager->searchItems( $search );
348
+		return $manager->searchItems($search);
349 349
 	}
350 350
 
351 351
 
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 		 * @since 2017.07
390 390
 		 * @category Developer
391 391
 		 */
392
-		return $this->getContext()->getConfig()->get( 'admin/jqadm/catalog/product/standard/subparts', [] );
392
+		return $this->getContext()->getConfig()->get('admin/jqadm/catalog/product/standard/subparts', []);
393 393
 	}
394 394
 
395 395
 
@@ -399,76 +399,76 @@  discard block
 block discarded – undo
399 399
 	 * @param \Aimeos\MShop\Catalog\Item\Iface $item Catalog item object without referenced domain items
400 400
 	 * @param string[] $data Data array
401 401
 	 */
402
-	protected function fromArray( \Aimeos\MShop\Catalog\Item\Iface $item, array $data )
402
+	protected function fromArray(\Aimeos\MShop\Catalog\Item\Iface $item, array $data)
403 403
 	{
404 404
 		$context = $this->getContext();
405
-		$listIds = $this->getValue( $data, 'catalog.lists.id', [] );
405
+		$listIds = $this->getValue($data, 'catalog.lists.id', []);
406 406
 
407
-		$listManager = \Aimeos\MShop\Factory::createManager( $context, 'catalog/lists' );
407
+		$listManager = \Aimeos\MShop\Factory::createManager($context, 'catalog/lists');
408 408
 
409
-		$search = $listManager->createSearch()->setSlice( 0, count( $listIds ) );
410
-		$search->setConditions( $search->compare( '==', 'catalog.lists.id', $listIds ) );
409
+		$search = $listManager->createSearch()->setSlice(0, count($listIds));
410
+		$search->setConditions($search->compare('==', 'catalog.lists.id', $listIds));
411 411
 
412 412
 		$listItem = $listManager->createItem();
413
-		$listItem->setParentId( $item->getId() );
414
-		$listItem->setDomain( 'product' );
413
+		$listItem->setParentId($item->getId());
414
+		$listItem->setDomain('product');
415 415
 
416 416
 
417
-		foreach( (array) $listIds as $idx => $listid )
417
+		foreach ((array) $listIds as $idx => $listid)
418 418
 		{
419
-			if( isset( $listItems[$listid] ) ) {
419
+			if (isset($listItems[$listid])) {
420 420
 				$litem = $listItems[$listid];
421 421
 			} else {
422 422
 				$litem = clone $listItem;
423 423
 			}
424 424
 
425
-			$litem->setId( $listid ?: null );
425
+			$litem->setId($listid ?: null);
426 426
 
427
-			if( isset( $data['catalog.lists.refid'][$idx] ) ) {
428
-				$litem->setRefId( $this->getValue( $data, 'catalog.lists.refid/' . $idx ) );
427
+			if (isset($data['catalog.lists.refid'][$idx])) {
428
+				$litem->setRefId($this->getValue($data, 'catalog.lists.refid/' . $idx));
429 429
 			}
430 430
 
431
-			if( isset( $data['catalog.lists.status'][$idx] ) ) {
432
-				$litem->setStatus( $this->getValue( $data, 'catalog.lists.status/' . $idx ) );
431
+			if (isset($data['catalog.lists.status'][$idx])) {
432
+				$litem->setStatus($this->getValue($data, 'catalog.lists.status/' . $idx));
433 433
 			}
434 434
 
435
-			if( isset( $data['catalog.lists.typeid'][$idx] ) ) {
436
-				$litem->setTypeId( $this->getValue( $data, 'catalog.lists.typeid/' . $idx ) );
435
+			if (isset($data['catalog.lists.typeid'][$idx])) {
436
+				$litem->setTypeId($this->getValue($data, 'catalog.lists.typeid/' . $idx));
437 437
 			}
438 438
 
439
-			if( isset( $data['catalog.lists.position'][$idx] ) ) {
440
-				$litem->setPosition( $this->getValue( $data, 'catalog.lists.position/' . $idx ) );
439
+			if (isset($data['catalog.lists.position'][$idx])) {
440
+				$litem->setPosition($this->getValue($data, 'catalog.lists.position/' . $idx));
441 441
 			}
442 442
 
443
-			if( isset( $data['catalog.lists.datestart'][$idx] ) ) {
444
-				$litem->setDateStart( $this->getValue( $data, 'catalog.lists.datestart/' . $idx ) );
443
+			if (isset($data['catalog.lists.datestart'][$idx])) {
444
+				$litem->setDateStart($this->getValue($data, 'catalog.lists.datestart/' . $idx));
445 445
 			}
446 446
 
447
-			if( isset( $data['catalog.lists.dateend'][$idx] ) ) {
448
-				$litem->setDateEnd( $this->getValue( $data, 'catalog.lists.dateend/' . $idx ) );
447
+			if (isset($data['catalog.lists.dateend'][$idx])) {
448
+				$litem->setDateEnd($this->getValue($data, 'catalog.lists.dateend/' . $idx));
449 449
 			}
450 450
 
451
-			if( isset( $data['catalog.lists.config'][$idx] )
452
-				&& ( $conf = json_decode( $this->getValue( $data, 'catalog.lists.config/' . $idx ), true ) ) !== null
451
+			if (isset($data['catalog.lists.config'][$idx])
452
+				&& ($conf = json_decode($this->getValue($data, 'catalog.lists.config/' . $idx), true)) !== null
453 453
 			) {
454
-				$litem->setConfig( $conf );
454
+				$litem->setConfig($conf);
455 455
 			}
456 456
 
457
-			if( isset( $data['config'][$idx]['key'] ) )
457
+			if (isset($data['config'][$idx]['key']))
458 458
 			{
459 459
 				$conf = [];
460 460
 
461
-				foreach( (array) $data['config'][$idx]['key'] as $pos => $key )
461
+				foreach ((array) $data['config'][$idx]['key'] as $pos => $key)
462 462
 				{
463
-					if( trim( $key ) !== '' && isset( $data['config'][$idx]['val'][$pos] ) ) {
463
+					if (trim($key) !== '' && isset($data['config'][$idx]['val'][$pos])) {
464 464
 						$conf[$key] = $data['config'][$idx]['val'][$pos];
465 465
 					}
466 466
 				}
467 467
 
468
-				$litem->setConfig( $conf );
468
+				$litem->setConfig($conf);
469 469
 			}
470 470
 
471
-			$listManager->saveItem( $litem, false );
471
+			$listManager->saveItem($litem, false);
472 472
 		}
473 473
 	}
474 474
 
@@ -479,13 +479,13 @@  discard block
 block discarded – undo
479 479
 	 * @param \Aimeos\MShop\Common\Item\Lists\Iface[] $listItems Catalog list items referencing the products
480 480
 	 * @return string[] Multi-dimensional associative list of item data
481 481
 	 */
482
-	protected function toArray( array $listItems )
482
+	protected function toArray(array $listItems)
483 483
 	{
484 484
 		$data = [];
485 485
 
486
-		foreach( $listItems as $listItem )
486
+		foreach ($listItems as $listItem)
487 487
 		{
488
-			foreach( $listItem->toArray( true ) as $key => $value ) {
488
+			foreach ($listItem->toArray(true) as $key => $value) {
489 489
 				$data[$key][] = $value;
490 490
 			}
491 491
 		}
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 	 * @param \Aimeos\MW\View\Iface $view View object with data assigned
501 501
 	 * @return string HTML output
502 502
 	 */
503
-	protected function render( \Aimeos\MW\View\Iface $view )
503
+	protected function render(\Aimeos\MW\View\Iface $view)
504 504
 	{
505 505
 		/** admin/jqadm/catalog/product/template-item
506 506
 		 * Relative path to the HTML body template of the product subpart for catalogs.
@@ -524,6 +524,6 @@  discard block
 block discarded – undo
524 524
 		$tplconf = 'admin/jqadm/catalog/product/template-item';
525 525
 		$default = 'catalog/item-product-standard.php';
526 526
 
527
-		return $view->render( $view->config( $tplconf, $default ) );
527
+		return $view->render($view->config($tplconf, $default));
528 528
 	}
529 529
 }
Please login to merge, or discard this patch.