Completed
Branch master (eb8dc7)
by Aimeos
03:09
created
admin/jsonadm/src/Admin/JsonAdm/Factory.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -101,8 +101,7 @@
 block discarded – undo
101 101
 				if( ( $client = @call_user_func_array( array( $factory, 'createClient' ), $args ) ) === false ) {
102 102
 					throw new \Aimeos\Admin\JsonAdm\Exception( sprintf( 'Invalid factory "%1$s"', $factory ), 400 );
103 103
 				}
104
-			}
105
-			else
104
+			} else
106 105
 			{
107 106
 				$client = self::createClientRoot( $context, $view, $templatePaths, $path, $name );
108 107
 			}
Please login to merge, or discard this patch.
admin/jsonadm/src/Admin/JsonAdm/Base.php 1 patch
Braces   +22 added lines, -44 removed lines patch added patch discarded remove patch
@@ -78,40 +78,35 @@  discard block
 block discarded – undo
78 78
 
79 79
 				$manager->deleteItems( $ids );
80 80
 				$view->total = count( $ids );
81
-			}
82
-			else
81
+			} else
83 82
 			{
84 83
 				$manager->deleteItem( $id );
85 84
 				$view->total = 1;
86 85
 			}
87 86
 
88 87
 			$status = 200;
89
-		}
90
-		catch( \Aimeos\Admin\JsonAdm\Exception $e )
88
+		} catch( \Aimeos\Admin\JsonAdm\Exception $e )
91 89
 		{
92 90
 			$status = $e->getCode();
93 91
 			$view->errors = array( array(
94 92
 				'title' => $context->getI18n()->dt( 'admin/jsonadm', $e->getMessage() ),
95 93
 				'detail' => $e->getTraceAsString(),
96 94
 			) );
97
-		}
98
-		catch( \Aimeos\MAdmin\Exception $e )
95
+		} catch( \Aimeos\MAdmin\Exception $e )
99 96
 		{
100 97
 			$status = 404;
101 98
 			$view->errors = array( array(
102 99
 				'title' => $context->getI18n()->dt( 'mshop', $e->getMessage() ),
103 100
 				'detail' => $e->getTraceAsString(),
104 101
 			) );
105
-		}
106
-		catch( \Aimeos\MShop\Exception $e )
102
+		} catch( \Aimeos\MShop\Exception $e )
107 103
 		{
108 104
 			$status = 404;
109 105
 			$view->errors = array( array(
110 106
 				'title' => $context->getI18n()->dt( 'mshop', $e->getMessage() ),
111 107
 				'detail' => $e->getTraceAsString(),
112 108
 			) );
113
-		}
114
-		catch( \Exception $e )
109
+		} catch( \Exception $e )
115 110
 		{
116 111
 			$status = 500;
117 112
 			$view->errors = array( array(
@@ -177,8 +172,7 @@  discard block
 block discarded – undo
177 172
 				$view->data = $manager->searchItems( $search, array(), $total );
178 173
 				$view->childItems = $this->getChildItems( $view->data, $include );
179 174
 				$view->listItems = $this->getListItems( $view->data, $include );
180
-			}
181
-			else
175
+			} else
182 176
 			{
183 177
 				$view->data = $manager->getItem( $id, array() );
184 178
 				$view->childItems = $this->getChildItems( array( $id => $view->data ), $include );
@@ -189,24 +183,21 @@  discard block
 block discarded – undo
189 183
 
190 184
 			$view->total = $total;
191 185
 			$status = 200;
192
-		}
193
-		catch( \Aimeos\MAdmin\Exception $e )
186
+		} catch( \Aimeos\MAdmin\Exception $e )
194 187
 		{
195 188
 			$status = 404;
196 189
 			$view->errors = array( array(
197 190
 				'title' => $context->getI18n()->dt( 'mshop', $e->getMessage() ),
198 191
 				'detail' => $e->getTraceAsString(),
199 192
 			) );
200
-		}
201
-		catch( \Aimeos\MShop\Exception $e )
193
+		} catch( \Aimeos\MShop\Exception $e )
202 194
 		{
203 195
 			$status = 404;
204 196
 			$view->errors = array( array(
205 197
 				'title' => $context->getI18n()->dt( 'mshop', $e->getMessage() ),
206 198
 				'detail' => $e->getTraceAsString(),
207 199
 			) );
208
-		}
209
-		catch( \Exception $e )
200
+		} catch( \Exception $e )
210 201
 		{
211 202
 			$status = 500;
212 203
 			$view->errors = array( array(
@@ -288,8 +279,7 @@  discard block
 block discarded – undo
288 279
 				$view->data = $data;
289 280
 				$view->total = count( $data );
290 281
 				$header['Content-Type'] = 'application/vnd.api+json; ext="bulk"; supported-ext="bulk"';
291
-			}
292
-			else
282
+			} else
293 283
 			{
294 284
 				if( ( $id = $view->param( 'id' ) ) == null ) {
295 285
 					throw new \Aimeos\Admin\JsonAdm\Exception( sprintf( 'No ID given' ), 400 );
@@ -309,32 +299,28 @@  discard block
 block discarded – undo
309 299
 			}
310 300
 
311 301
 			$status = 200;
312
-		}
313
-		catch( \Aimeos\Admin\JsonAdm\Exception $e )
302
+		} catch( \Aimeos\Admin\JsonAdm\Exception $e )
314 303
 		{
315 304
 			$status = $e->getCode();
316 305
 			$view->errors = array( array(
317 306
 				'title' => $context->getI18n()->dt( 'admin/jsonadm', $e->getMessage() ),
318 307
 				'detail' => $e->getTraceAsString(),
319 308
 			) );
320
-		}
321
-		catch( \Aimeos\MAdmin\Exception $e )
309
+		} catch( \Aimeos\MAdmin\Exception $e )
322 310
 		{
323 311
 			$status = 404;
324 312
 			$view->errors = array( array(
325 313
 				'title' => $context->getI18n()->dt( 'mshop', $e->getMessage() ),
326 314
 				'detail' => $e->getTraceAsString(),
327 315
 			) );
328
-		}
329
-		catch( \Aimeos\MShop\Exception $e )
316
+		} catch( \Aimeos\MShop\Exception $e )
330 317
 		{
331 318
 			$status = 404;
332 319
 			$view->errors = array( array(
333 320
 				'title' => $context->getI18n()->dt( 'mshop', $e->getMessage() ),
334 321
 				'detail' => $e->getTraceAsString(),
335 322
 			) );
336
-		}
337
-		catch( \Aimeos\MW\Exception $e )
323
+		} catch( \Aimeos\MW\Exception $e )
338 324
 		{
339 325
 			$status = 500;
340 326
 			$view->errors = array( array(
@@ -420,8 +406,7 @@  discard block
 block discarded – undo
420 406
 				$view->data = $data;
421 407
 				$view->total = count( $data );
422 408
 				$header['Content-Type'] = 'application/vnd.api+json; ext="bulk"; supported-ext="bulk"';
423
-			}
424
-			else
409
+			} else
425 410
 			{
426 411
 				if( isset( $request->data->attributes ) )
427 412
 				{
@@ -437,32 +422,28 @@  discard block
 block discarded – undo
437 422
 			}
438 423
 
439 424
 			$status = 201;
440
-		}
441
-		catch( \Aimeos\Admin\JsonAdm\Exception $e )
425
+		} catch( \Aimeos\Admin\JsonAdm\Exception $e )
442 426
 		{
443 427
 			$status = $e->getCode();
444 428
 			$view->errors = array( array(
445 429
 				'title' => $context->getI18n()->dt( 'admin/jsonadm', $e->getMessage() ),
446 430
 				'detail' => $e->getTraceAsString(),
447 431
 			) );
448
-		}
449
-		catch( \Aimeos\MAdmin\Exception $e )
432
+		} catch( \Aimeos\MAdmin\Exception $e )
450 433
 		{
451 434
 			$status = 404;
452 435
 			$view->errors = array( array(
453 436
 				'title' => $context->getI18n()->dt( 'mshop', $e->getMessage() ),
454 437
 				'detail' => $e->getTraceAsString(),
455 438
 			) );
456
-		}
457
-		catch( \Aimeos\MShop\Exception $e )
439
+		} catch( \Aimeos\MShop\Exception $e )
458 440
 		{
459 441
 			$status = 404;
460 442
 			$view->errors = array( array(
461 443
 				'title' => $context->getI18n()->dt( 'mshop', $e->getMessage() ),
462 444
 				'detail' => $e->getTraceAsString(),
463 445
 			) );
464
-		}
465
-		catch( \Exception $e )
446
+		} catch( \Exception $e )
466 447
 		{
467 448
 			$status = 500;
468 449
 			$view->errors = array( array(
@@ -610,24 +591,21 @@  discard block
 block discarded – undo
610 591
 				'Allow' => 'DELETE,GET,POST,OPTIONS'
611 592
 			);
612 593
 			$status = 200;
613
-		}
614
-		catch( \Aimeos\MAdmin\Exception $e )
594
+		} catch( \Aimeos\MAdmin\Exception $e )
615 595
 		{
616 596
 			$status = 404;
617 597
 			$view->errors = array( array(
618 598
 				'title' => $context->getI18n()->dt( 'mshop', $e->getMessage() ),
619 599
 				'detail' => $e->getTraceAsString(),
620 600
 			) );
621
-		}
622
-		catch( \Aimeos\MShop\Exception $e )
601
+		} catch( \Aimeos\MShop\Exception $e )
623 602
 		{
624 603
 			$status = 404;
625 604
 			$view->errors = array( array(
626 605
 				'title' => $context->getI18n()->dt( 'mshop', $e->getMessage() ),
627 606
 				'detail' => $e->getTraceAsString(),
628 607
 			) );
629
-		}
630
-		catch( \Exception $e )
608
+		} catch( \Exception $e )
631 609
 		{
632 610
 			$status = 500;
633 611
 			$view->errors = array( array(
Please login to merge, or discard this patch.
admin/jsonadm/templates/partials/data-standard.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,12 +63,10 @@
 block discarded – undo
63 63
 	foreach( $data as $item ) {
64 64
 		$response[] = $build( $item, $fields, $childItems, $listItems );
65 65
 	}
66
-}
67
-elseif( $data !== null )
66
+} elseif( $data !== null )
68 67
 {
69 68
 	$response = $build( $data, $fields, $childItems, $listItems );
70
-}
71
-else
69
+} else
72 70
 {
73 71
 	$response = null;
74 72
 }
Please login to merge, or discard this patch.
admin/jsonadm/templates/partials/order/data-standard.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,12 +54,10 @@
 block discarded – undo
54 54
 	foreach( $data as $item ) {
55 55
 		$response[] = $build( $item, $fields, $childItems );
56 56
 	}
57
-}
58
-elseif( $data !== null )
57
+} elseif( $data !== null )
59 58
 {
60 59
 	$response = $build( $data, $fields, $childItems );
61
-}
62
-else
60
+} else
63 61
 {
64 62
 	$response = null;
65 63
 }
Please login to merge, or discard this patch.
admin/jsonadm/templates/partials/order/base/data-standard.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,12 +52,10 @@
 block discarded – undo
52 52
 	foreach( $data as $item ) {
53 53
 		$response[] = $build( $item, $fields, $childItems );
54 54
 	}
55
-}
56
-elseif( $data !== null )
55
+} elseif( $data !== null )
57 56
 {
58 57
 	$response = $build( $data, $fields, $childItems );
59
-}
60
-else
58
+} else
61 59
 {
62 60
 	$response = null;
63 61
 }
Please login to merge, or discard this patch.