Completed
Push — master ( 04698d...397d53 )
by Aimeos
06:07
created
admin/jsonadm/src/Admin/JsonAdm/Factory.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -136,8 +136,7 @@
 block discarded – undo
136 136
 			if( ( $client = @call_user_func_array( array( $factory, 'createClient' ), $args ) ) === false ) {
137 137
 				throw new \Aimeos\Admin\JsonAdm\Exception( sprintf( 'Invalid factory "%1$s"', $factory ), 400 );
138 138
 			}
139
-		}
140
-		else
139
+		} else
141 140
 		{
142 141
 			$client = self::createClientRoot( $context, $view, $templatePaths, $path, $name );
143 142
 		}
Please login to merge, or discard this patch.
admin/jsonadm/src/Admin/JsonAdm/Catalog/Standard.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -182,8 +182,7 @@  discard block
 block discarded – undo
182 182
 			$view->data = $manager->searchItems( $search, [], $total );
183 183
 			$view->listItems = $this->getListItems( $view->data, $include );
184 184
 			$view->childItems = $this->getChildItems( $view->data, $include );
185
-		}
186
-		else
185
+		} else
187 186
 		{
188 187
 			$view->data = $manager->getTree( $id, [], \Aimeos\MW\Tree\Manager\Base::LEVEL_LIST, $search );
189 188
 			$view->listItems = $this->getListItems( array( $id => $view->data ), $include );
@@ -240,8 +239,7 @@  discard block
 block discarded – undo
240 239
 			if( isset( $entry->parentid ) && $targetId !== null ) {
241 240
 				$manager->moveItem( $item->getId(), $entry->parentid, $targetId, $refId );
242 241
 			}
243
-		}
244
-		else
242
+		} else
245 243
 		{
246 244
 			$item = $manager->createItem();
247 245
 			$item = $this->addItemData( $manager, $item, $entry, $item->getResourceType() );
Please login to merge, or discard this patch.
admin/jsonadm/src/Admin/JsonAdm/Common/Factory/Base.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
 				$decorators = $config->get( 'admin/jsonadm/' . $dpath . 'decorators/local', [] );
102 102
 				$client = self::addDecorators( $client, $decorators, $classprefix, $context, $view, $templatePaths, $path );
103 103
 			}
104
-		}
105
-		else
104
+		} else
106 105
 		{
107 106
 			$classprefix = '\\Aimeos\\Admin\\JsonAdm\\Common\\Decorator\\';
108 107
 			$client = self::addDecorators( $client, $decorators, $classprefix, $context, $view, $templatePaths, $path );
Please login to merge, or discard this patch.
admin/jsonadm/src/Admin/JsonAdm/Locale/Site/Standard.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -175,8 +175,7 @@  discard block
 block discarded – undo
175 175
 		{
176 176
 			$view->data = $manager->searchItems( $search, [], $total );
177 177
 			$view->childItems = $this->getChildItems( $view->data, $include );
178
-		}
179
-		else
178
+		} else
180 179
 		{
181 180
 			$view->data = $manager->getTree( $id, [], \Aimeos\MW\Tree\Manager\Base::LEVEL_LIST, $search );
182 181
 			$view->childItems = $this->getChildItems( array( $view->data ), $include );
@@ -211,8 +210,7 @@  discard block
 block discarded – undo
211 210
 			if( isset( $entry->parentid ) && $targetId !== null ) {
212 211
 				$manager->moveItem( $item->getId(), $entry->parentid, $targetId, $refId );
213 212
 			}
214
-		}
215
-		else
213
+		} else
216 214
 		{
217 215
 			$item = $manager->createItem();
218 216
 			$item = $this->addItemData( $manager, $item, $entry, $item->getResourceType() );
Please login to merge, or discard this patch.
admin/jsonadm/src/Admin/JsonAdm/Standard.php 1 patch
Braces   +19 added lines, -38 removed lines patch added patch discarded remove patch
@@ -39,24 +39,21 @@  discard block
 block discarded – undo
39 39
 		{
40 40
 			$response = $this->deleteItems( $view, $request, $response );
41 41
 			$status = 200;
42
-		}
43
-		catch( \Aimeos\Admin\JsonAdm\Exception $e )
42
+		} catch( \Aimeos\Admin\JsonAdm\Exception $e )
44 43
 		{
45 44
 			$status = $e->getCode();
46 45
 			$view->errors = array( array(
47 46
 				'title' => $this->getContext()->getI18n()->dt( 'admin/jsonadm', $e->getMessage() ),
48 47
 				'detail' => $e->getTraceAsString(),
49 48
 			) );
50
-		}
51
-		catch( \Aimeos\MShop\Exception $e )
49
+		} catch( \Aimeos\MShop\Exception $e )
52 50
 		{
53 51
 			$status = 404;
54 52
 			$view->errors = array( array(
55 53
 				'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ),
56 54
 				'detail' => $e->getTraceAsString(),
57 55
 			) );
58
-		}
59
-		catch( \Exception $e )
56
+		} catch( \Exception $e )
60 57
 		{
61 58
 			$status = 500;
62 59
 			$view->errors = array( array(
@@ -116,16 +113,14 @@  discard block
 block discarded – undo
116 113
 		{
117 114
 			$response = $this->getItems( $view, $request, $response );
118 115
 			$status = 200;
119
-		}
120
-		catch( \Aimeos\MShop\Exception $e )
116
+		} catch( \Aimeos\MShop\Exception $e )
121 117
 		{
122 118
 			$status = 404;
123 119
 			$view->errors = array( array(
124 120
 				'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ),
125 121
 				'detail' => $e->getTraceAsString(),
126 122
 			) );
127
-		}
128
-		catch( \Exception $e )
123
+		} catch( \Exception $e )
129 124
 		{
130 125
 			$status = 500;
131 126
 			$view->errors = array( array(
@@ -163,8 +158,7 @@  discard block
 block discarded – undo
163 158
 			 */
164 159
 			$tplconf = 'admin/jsonadm/standard/template-aggregate';
165 160
 			$default = 'aggregate-default.php';
166
-		}
167
-		else
161
+		} else
168 162
 		{
169 163
 			/** admin/jsonadm/standard/template-get
170 164
 			 * Relative path to the JSON API template for GET requests
@@ -218,24 +212,21 @@  discard block
 block discarded – undo
218 212
 		{
219 213
 			$response = $this->patchItems( $view, $request, $response );
220 214
 			$status = 200;
221
-		}
222
-		catch( \Aimeos\Admin\JsonAdm\Exception $e )
215
+		} catch( \Aimeos\Admin\JsonAdm\Exception $e )
223 216
 		{
224 217
 			$status = $e->getCode();
225 218
 			$view->errors = array( array(
226 219
 				'title' => $this->getContext()->getI18n()->dt( 'admin/jsonadm', $e->getMessage() ),
227 220
 				'detail' => $e->getTraceAsString(),
228 221
 			) );
229
-		}
230
-		catch( \Aimeos\MShop\Exception $e )
222
+		} catch( \Aimeos\MShop\Exception $e )
231 223
 		{
232 224
 			$status = 404;
233 225
 			$view->errors = array( array(
234 226
 				'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ),
235 227
 				'detail' => $e->getTraceAsString(),
236 228
 			) );
237
-		}
238
-		catch( \Exception $e )
229
+		} catch( \Exception $e )
239 230
 		{
240 231
 			$status = 500;
241 232
 			$view->errors = array( array(
@@ -295,24 +286,21 @@  discard block
 block discarded – undo
295 286
 		{
296 287
 			$response = $this->postItems( $view, $request, $response );
297 288
 			$status = 201;
298
-		}
299
-		catch( \Aimeos\Admin\JsonAdm\Exception $e )
289
+		} catch( \Aimeos\Admin\JsonAdm\Exception $e )
300 290
 		{
301 291
 			$status = $e->getCode();
302 292
 			$view->errors = array( array(
303 293
 				'title' => $this->getContext()->getI18n()->dt( 'admin/jsonadm', $e->getMessage() ),
304 294
 				'detail' => $e->getTraceAsString(),
305 295
 			) );
306
-		}
307
-		catch( \Aimeos\MShop\Exception $e )
296
+		} catch( \Aimeos\MShop\Exception $e )
308 297
 		{
309 298
 			$status = 404;
310 299
 			$view->errors = array( array(
311 300
 				'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ),
312 301
 				'detail' => $e->getTraceAsString(),
313 302
 			) );
314
-		}
315
-		catch( \Exception $e )
303
+		} catch( \Exception $e )
316 304
 		{
317 305
 			$status = 500;
318 306
 			$view->errors = array( array(
@@ -438,16 +426,14 @@  discard block
 block discarded – undo
438 426
 			$view->attributes = $attributes;
439 427
 
440 428
 			$status = 200;
441
-		}
442
-		catch( \Aimeos\MShop\Exception $e )
429
+		} catch( \Aimeos\MShop\Exception $e )
443 430
 		{
444 431
 			$status = 404;
445 432
 			$view->errors = array( array(
446 433
 				'title' => $context->getI18n()->dt( 'mshop', $e->getMessage() ),
447 434
 				'detail' => $e->getTraceAsString(),
448 435
 			) );
449
-		}
450
-		catch( \Exception $e )
436
+		} catch( \Exception $e )
451 437
 		{
452 438
 			$status = 500;
453 439
 			$view->errors = array( array(
@@ -517,8 +503,7 @@  discard block
 block discarded – undo
517 503
 			$ids = $this->getIds( $payload );
518 504
 			$manager->deleteItems( $ids );
519 505
 			$view->total = count( $ids );
520
-		}
521
-		else
506
+		} else
522 507
 		{
523 508
 			$manager->deleteItem( $id );
524 509
 			$view->total = 1;
@@ -556,8 +541,7 @@  discard block
 block discarded – undo
556 541
 			$view->data = $manager->searchItems( $search, [], $total );
557 542
 			$view->childItems = $this->getChildItems( $view->data, $include );
558 543
 			$view->listItems = $this->getListItems( $view->data, $include );
559
-		}
560
-		else
544
+		} else
561 545
 		{
562 546
 			$view->data = $manager->getItem( $id, [] );
563 547
 			$view->childItems = $this->getChildItems( array( $id => $view->data ), $include );
@@ -597,16 +581,14 @@  discard block
 block discarded – undo
597 581
 			$view->data = $data;
598 582
 			$view->total = count( $data );
599 583
 			$response = $response->withHeader( 'Content-Type', 'application/vnd.api+json; ext="bulk"; supported-ext="bulk"' );
600
-		}
601
-		elseif( ( $id = $view->param( 'id' ) ) != null )
584
+		} elseif( ( $id = $view->param( 'id' ) ) != null )
602 585
 		{
603 586
 			$payload->data->id = $id;
604 587
 			$data = $this->saveEntry( $manager, $payload->data );
605 588
 
606 589
 			$view->data = $data;
607 590
 			$view->total = 1;
608
-		}
609
-		else
591
+		} else
610 592
 		{
611 593
 			throw new \Aimeos\Admin\JsonAdm\Exception( sprintf( 'No ID given' ), 400 );
612 594
 		}
@@ -645,8 +627,7 @@  discard block
 block discarded – undo
645 627
 			$view->data = $data;
646 628
 			$view->total = count( $data );
647 629
 			$response = $response->withHeader( 'Content-Type', 'application/vnd.api+json; ext="bulk"; supported-ext="bulk"' );
648
-		}
649
-		else
630
+		} else
650 631
 		{
651 632
 			$payload->data->id = null;
652 633
 			$data = $this->saveEntry( $manager, $payload->data );
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
@@ -89,12 +89,10 @@
 block discarded – undo
89 89
 	foreach( $data as $item ) {
90 90
 		$response[] = $build( $item, $childItems, $listItems );
91 91
 	}
92
-}
93
-elseif( $data !== null )
92
+} elseif( $data !== null )
94 93
 {
95 94
 	$response = $build( $data, $childItems, $listItems );
96
-}
97
-else
95
+} else
98 96
 {
99 97
 	$response = null;
100 98
 }
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
@@ -79,12 +79,10 @@
 block discarded – undo
79 79
 	foreach( $data as $item ) {
80 80
 		$response[] = $build( $item, $childItems );
81 81
 	}
82
-}
83
-elseif( $data !== null )
82
+} elseif( $data !== null )
84 83
 {
85 84
 	$response = $build( $data, $childItems );
86
-}
87
-else
85
+} else
88 86
 {
89 87
 	$response = null;
90 88
 }
Please login to merge, or discard this patch.
admin/jsonadm/templates/partials/catalog/data-standard.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -85,12 +85,10 @@
 block discarded – undo
85 85
 	foreach( $data as $item ) {
86 86
 		$response[] = $build( $item, $listItems );
87 87
 	}
88
-}
89
-elseif( $data !== null )
88
+} elseif( $data !== null )
90 89
 {
91 90
 	$response = $build( $data, $listItems );
92
-}
93
-else
91
+} else
94 92
 {
95 93
 	$response = null;
96 94
 }
Please login to merge, or discard this patch.
admin/jsonadm/templates/partials/locale/site/data-standard.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -66,12 +66,10 @@
 block discarded – undo
66 66
 	foreach( $data as $item ) {
67 67
 		$response[] = $build( $item );
68 68
 	}
69
-}
70
-elseif( $data !== null )
69
+} elseif( $data !== null )
71 70
 {
72 71
 	$response = $build( $data );
73
-}
74
-else
72
+} else
75 73
 {
76 74
 	$response = null;
77 75
 }
Please login to merge, or discard this patch.