| @@ -99,8 +99,7 @@ | ||
| 99 | 99 | $decorators = $config->get( 'admin/jsonadm/' . $dpath . 'decorators/local', [] ); | 
| 100 | 100 | $client = self::addDecorators( $client, $decorators, $classprefix, $context, $path ); | 
| 101 | 101 | } | 
| 102 | - } | |
| 103 | - else | |
| 102 | + } else | |
| 104 | 103 |  		{ | 
| 105 | 104 | $classprefix = '\\Aimeos\\Admin\\JsonAdm\\Common\\Decorator\\'; | 
| 106 | 105 | $client = self::addDecorators( $client, $decorators, $classprefix, $context, $path ); | 
| @@ -180,8 +180,7 @@ | ||
| 180 | 180 | } | 
| 181 | 181 | |
| 182 | 182 | $item = $manager->saveItem( $item ); | 
| 183 | - } | |
| 184 | - else | |
| 183 | + } else | |
| 185 | 184 |  		{ | 
| 186 | 185 | $item = $manager->createItem(); | 
| 187 | 186 | |
| @@ -182,8 +182,7 @@ discard block | ||
| 182 | 182 | $view->data = $manager->searchItems( $search, [], $total ); | 
| 183 | 183 | $view->listItems = $this->getListItems( $view->data, $include ); | 
| 184 | 184 | $view->childItems = []; | 
| 185 | - } | |
| 186 | - else | |
| 185 | + } else | |
| 187 | 186 |  		{ | 
| 188 | 187 | $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE; | 
| 189 | 188 |  			if( in_array( 'catalog', $include ) ) { | 
| @@ -249,8 +248,7 @@ discard block | ||
| 249 | 248 |  			if( isset( $entry->parentid ) && $targetId !== null ) { | 
| 250 | 249 | $manager->moveItem( $item->getId(), $entry->parentid, $targetId, $refId ); | 
| 251 | 250 | } | 
| 252 | - } | |
| 253 | - else | |
| 251 | + } else | |
| 254 | 252 |  		{ | 
| 255 | 253 | $item = $manager->createItem(); | 
| 256 | 254 | |
| @@ -163,8 +163,7 @@ discard block | ||
| 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 | ||
| 519 | 518 | $ids = $this->getIds( $payload ); | 
| 520 | 519 | $manager->deleteItems( $ids ); | 
| 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 | ||
| 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( array( $id => $view->data ), $include ); | 
| @@ -599,16 +596,14 @@ discard block | ||
| 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 | ||
| 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 ); | 
| @@ -21,8 +21,7 @@ discard block | ||
| 21 | 21 | } | 
| 22 | 22 | |
| 23 | 23 | |
| 24 | -$build = function( \Aimeos\MShop\Locale\Item\Site\Iface $item ) use ( $fields ) | |
| 25 | -{ | |
| 24 | +$build = function( \Aimeos\MShop\Locale\Item\Site\Iface $item ) use ( $fields ) { | |
| 26 | 25 | $id = $item->getId(); | 
| 27 | 26 | $type = $item->getResourceType(); | 
| 28 | 27 | $params = array( 'resource' => $type, 'id' => $id ); | 
| @@ -66,12 +65,10 @@ discard block | ||
| 66 | 65 |  	foreach( $data as $item ) { | 
| 67 | 66 | $response[] = $build( $item ); | 
| 68 | 67 | } | 
| 69 | -} | |
| 70 | -elseif( $data !== null ) | |
| 68 | +} elseif( $data !== null ) | |
| 71 | 69 |  { | 
| 72 | 70 | $response = $build( $data ); | 
| 73 | -} | |
| 74 | -else | |
| 71 | +} else | |
| 75 | 72 |  { | 
| 76 | 73 | $response = null; | 
| 77 | 74 | } | 
| @@ -21,8 +21,7 @@ discard block | ||
| 21 | 21 | } | 
| 22 | 22 | |
| 23 | 23 | |
| 24 | -$build = function( \Aimeos\MShop\Catalog\Item\Iface $item, array $listItems ) use ( $fields ) | |
| 25 | -{ | |
| 24 | +$build = function( \Aimeos\MShop\Catalog\Item\Iface $item, array $listItems ) use ( $fields ) { | |
| 26 | 25 | $id = $item->getId(); | 
| 27 | 26 | $type = $item->getResourceType(); | 
| 28 | 27 | $params = array( 'resource' => $type, 'id' => $id ); | 
| @@ -85,12 +84,10 @@ discard block | ||
| 85 | 84 |  	foreach( $data as $item ) { | 
| 86 | 85 | $response[] = $build( $item, $listItems ); | 
| 87 | 86 | } | 
| 88 | -} | |
| 89 | -elseif( $data !== null ) | |
| 87 | +} elseif( $data !== null ) | |
| 90 | 88 |  { | 
| 91 | 89 | $response = $build( $data, $listItems ); | 
| 92 | -} | |
| 93 | -else | |
| 90 | +} else | |
| 94 | 91 |  { | 
| 95 | 92 | $response = null; | 
| 96 | 93 | } | 
| @@ -21,8 +21,7 @@ discard block | ||
| 21 | 21 | } | 
| 22 | 22 | |
| 23 | 23 | |
| 24 | -$build = function( \Aimeos\MShop\Common\Item\Iface $item, array $childItems, array $listItems ) use ( $fields ) | |
| 25 | -{ | |
| 24 | +$build = function( \Aimeos\MShop\Common\Item\Iface $item, array $childItems, array $listItems ) use ( $fields ) { | |
| 26 | 25 | $id = strtoupper( $item->getId() ); | 
| 27 | 26 | $type = $item->getResourceType(); | 
| 28 | 27 | $params = array( 'resource' => $type, 'id' => $id ); | 
| @@ -89,12 +88,10 @@ discard block | ||
| 89 | 88 |  	foreach( $data as $item ) { | 
| 90 | 89 | $response[] = $build( $item, $childItems, $listItems ); | 
| 91 | 90 | } | 
| 92 | -} | |
| 93 | -elseif( $data !== null ) | |
| 91 | +} elseif( $data !== null ) | |
| 94 | 92 |  { | 
| 95 | 93 | $response = $build( $data, $childItems, $listItems ); | 
| 96 | -} | |
| 97 | -else | |
| 94 | +} else | |
| 98 | 95 |  { | 
| 99 | 96 | $response = null; | 
| 100 | 97 | } | 
| @@ -21,8 +21,7 @@ | ||
| 21 | 21 | } | 
| 22 | 22 | |
| 23 | 23 | |
| 24 | -$build = function( array $items ) use ( $fields ) | |
| 25 | -{ | |
| 24 | +$build = function( array $items ) use ( $fields ) { | |
| 26 | 25 | $list = []; | 
| 27 | 26 | |
| 28 | 27 | $target = $this->config( 'admin/jsonadm/url/target' ); | 
| @@ -21,8 +21,7 @@ discard block | ||
| 21 | 21 | } | 
| 22 | 22 | |
| 23 | 23 | |
| 24 | -$build = function( \Aimeos\MShop\Order\Item\Iface $item, array $childItems ) use ( $fields ) | |
| 25 | -{ | |
| 24 | +$build = function( \Aimeos\MShop\Order\Item\Iface $item, array $childItems ) use ( $fields ) { | |
| 26 | 25 | $id = $item->getId(); | 
| 27 | 26 | $baseId = $item->getBaseId(); | 
| 28 | 27 | $type = $item->getResourceType(); | 
| @@ -79,12 +78,10 @@ discard block | ||
| 79 | 78 |  	foreach( $data as $item ) { | 
| 80 | 79 | $response[] = $build( $item, $childItems ); | 
| 81 | 80 | } | 
| 82 | -} | |
| 83 | -elseif( $data !== null ) | |
| 81 | +} elseif( $data !== null ) | |
| 84 | 82 |  { | 
| 85 | 83 | $response = $build( $data, $childItems ); | 
| 86 | -} | |
| 87 | -else | |
| 84 | +} else | |
| 88 | 85 |  { | 
| 89 | 86 | $response = null; | 
| 90 | 87 | } |