Passed
Pull Request — master (#8)
by
unknown
02:14
created
admin/jsonadm/src/Admin/JsonAdm/Standard.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -163,8 +163,7 @@  discard block
 block discarded – undo
163 163
 			 */
164 164
 			$tplconf = 'admin/jsonadm/standard/template-aggregate';
165 165
 			$default = 'aggregate-standard';
166
-		}
167
-		else
166
+		} else
168 167
 		{
169 168
 			/** admin/jsonadm/standard/template-get
170 169
 			 * Relative path to the JSON API template for GET requests
@@ -519,8 +518,7 @@  discard block
 block discarded – undo
519 518
 			$ids = map( $payload->data )->col( 'id' );
520 519
 			$manager->deleteItems( $ids->toArray() );
521 520
 			$view->total = count( $ids );
522
-		}
523
-		else
521
+		} else
524 522
 		{
525 523
 			$manager->deleteItem( $id );
526 524
 			$view->total = 1;
@@ -558,8 +556,7 @@  discard block
 block discarded – undo
558 556
 			$view->data = $manager->searchItems( $search, [], $total );
559 557
 			$view->childItems = $this->getChildItems( $view->data, $include );
560 558
 			$view->listItems = $this->getListItems( $view->data, $include );
561
-		}
562
-		else
559
+		} else
563 560
 		{
564 561
 			$view->data = $manager->getItem( $id, [] );
565 562
 			$view->childItems = $this->getChildItems( map( [$id => $view->data] ), $include );
@@ -599,16 +596,14 @@  discard block
 block discarded – undo
599 596
 			$view->data = $data;
600 597
 			$view->total = count( $data );
601 598
 			$response = $response->withHeader( 'Content-Type', 'application/vnd.api+json; ext="bulk"; supported-ext="bulk"' );
602
-		}
603
-		elseif( ( $id = $view->param( 'id' ) ) != null )
599
+		} elseif( ( $id = $view->param( 'id' ) ) != null )
604 600
 		{
605 601
 			$payload->data->id = $id;
606 602
 			$data = $this->saveEntry( $manager, $payload->data );
607 603
 
608 604
 			$view->data = $data;
609 605
 			$view->total = 1;
610
-		}
611
-		else
606
+		} else
612 607
 		{
613 608
 			throw new \Aimeos\Admin\JsonAdm\Exception( sprintf( 'No ID given' ), 400 );
614 609
 		}
@@ -647,8 +642,7 @@  discard block
 block discarded – undo
647 642
 			$view->data = $data;
648 643
 			$view->total = count( $data );
649 644
 			$response = $response->withHeader( 'Content-Type', 'application/vnd.api+json; ext="bulk"; supported-ext="bulk"' );
650
-		}
651
-		else
645
+		} else
652 646
 		{
653 647
 			$payload->data->id = null;
654 648
 			$data = $this->saveEntry( $manager, $payload->data );
Please login to merge, or discard this patch.
admin/jsonadm/src/Admin/JsonAdm/Service/Standard.php 2 patches
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -121,34 +121,34 @@
 block discarded – undo
121 121
 		return $manager->searchItems( $search );
122 122
 	}
123 123
 	
124
-     /**
125
-     * Saves and returns the new or updated item
126
-     *
127
-     * @param \Aimeos\MShop\Common\Manager\Iface $manager Manager responsible for the items
128
-     * @param \stdClass $entry Object including "id" and "attributes" elements
129
-     * @return \Aimeos\MShop\Common\Item\Iface New or updated item
130
-     */
131
-    protected function saveEntry( \Aimeos\MShop\Common\Manager\Iface $manager, \stdClass $entry ) : \Aimeos\MShop\Common\Item\Iface
132
-    {
133
-        if( isset( $entry->id ) ) {
134
-            $item = $manager->getItem( $entry->id );
135
-        } else {
136
-            $item = $manager->createItem();
137
-        }
124
+	 /**
125
+	  * Saves and returns the new or updated item
126
+	  *
127
+	  * @param \Aimeos\MShop\Common\Manager\Iface $manager Manager responsible for the items
128
+	  * @param \stdClass $entry Object including "id" and "attributes" elements
129
+	  * @return \Aimeos\MShop\Common\Item\Iface New or updated item
130
+	  */
131
+	protected function saveEntry( \Aimeos\MShop\Common\Manager\Iface $manager, \stdClass $entry ) : \Aimeos\MShop\Common\Item\Iface
132
+	{
133
+		if( isset( $entry->id ) ) {
134
+			$item = $manager->getItem( $entry->id );
135
+		} else {
136
+			$item = $manager->createItem();
137
+		}
138 138
 
139
-        if( isset( $entry->attributes ) && ( $attr = (array) $entry->attributes ) ) {
140
-            if(isset($attr["service.config"])) {
141
-                $attr["service.config"] = (array) $attr["service.config"];
142
-            }
143
-            $item = $item->fromArray( $attr, true );
144
-        }
139
+		if( isset( $entry->attributes ) && ( $attr = (array) $entry->attributes ) ) {
140
+			if(isset($attr["service.config"])) {
141
+				$attr["service.config"] = (array) $attr["service.config"];
142
+			}
143
+			$item = $item->fromArray( $attr, true );
144
+		}
145 145
 
146
-        $item = $manager->saveItem( $item );
146
+		$item = $manager->saveItem( $item );
147 147
 
148
-        if( isset( $entry->relationships ) ) {
149
-            $this->saveRelationships( $manager, $item, $entry->relationships );
150
-        }
148
+		if( isset( $entry->relationships ) ) {
149
+			$this->saveRelationships( $manager, $item, $entry->relationships );
150
+		}
151 151
 
152
-        return $manager->getItem( $item->getId() );
153
-    }
152
+		return $manager->getItem( $item->getId() );
153
+	}
154 154
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@
 block discarded – undo
137 137
         }
138 138
 
139 139
         if( isset( $entry->attributes ) && ( $attr = (array) $entry->attributes ) ) {
140
-            if(isset($attr["service.config"])) {
140
+            if( isset( $attr["service.config"] ) ) {
141 141
                 $attr["service.config"] = (array) $attr["service.config"];
142 142
             }
143 143
             $item = $item->fromArray( $attr, true );
Please login to merge, or discard this patch.