@@ -263,9 +263,12 @@ discard block |
||
| 263 | 263 | { |
| 264 | 264 | foreach( $codes as $code ) |
| 265 | 265 | { |
| 266 | - try { |
|
| 266 | + try |
|
| 267 | + { |
|
| 267 | 268 | $newOrder->addCoupon( $code ); |
| 268 | - } catch( \Aimeos\MShop\Plugin\Provider\Exception | \Aimeos\MShop\Coupon\Exception $e ) { |
|
| 269 | + } |
|
| 270 | + catch( \Aimeos\MShop\Plugin\Provider\Exception | \Aimeos\MShop\Coupon\Exception $e ) |
|
| 271 | + { |
|
| 269 | 272 | $newOrder->deleteCoupon( $code ); |
| 270 | 273 | } |
| 271 | 274 | } |
@@ -384,7 +387,9 @@ discard block |
||
| 384 | 387 | $groupItems = $manager->search( $filter->slice( 0, count( $customerItem->getGroups() ) ) )->all(); |
| 385 | 388 | $context->setGroups( $groupItems ); |
| 386 | 389 | } |
| 387 | - catch( \Exception $e ) {} // Subscription without account |
|
| 390 | + catch( \Exception $e ) |
|
| 391 | + { |
|
| 392 | +} // Subscription without account |
|
| 388 | 393 | |
| 389 | 394 | return $context; |
| 390 | 395 | } |
@@ -570,9 +575,11 @@ discard block |
||
| 570 | 575 | } |
| 571 | 576 | catch( \Exception $e ) |
| 572 | 577 | { |
| 573 | - if( $e->getCode() < 1 ) // not a soft error |
|
| 578 | + if( $e->getCode() < 1 ) { |
|
| 579 | + // not a soft error |
|
| 574 | 580 | { |
| 575 | 581 | $item->setReason( \Aimeos\MShop\Subscription\Item\Iface::REASON_PAYMENT ); |
| 582 | + } |
|
| 576 | 583 | |
| 577 | 584 | if( $this->ends() ) { |
| 578 | 585 | $item->setDateEnd( date_create()->format( 'Y-m-d H:i:s' ) ); |
@@ -78,8 +78,7 @@ discard block |
||
| 78 | 78 | foreach( $manager->search( $search ) as $item ) { |
| 79 | 79 | $this->listTypes[$item->getCode()] = $item->getCode(); |
| 80 | 80 | } |
| 81 | - } |
|
| 82 | - else |
|
| 81 | + } else |
|
| 83 | 82 | { |
| 84 | 83 | $this->listTypes = array_combine( $this->listTypes, $this->listTypes ); |
| 85 | 84 | } |
@@ -137,8 +136,7 @@ discard block |
||
| 137 | 136 | $listItem = $listMap[$content][$type][$listtype]; |
| 138 | 137 | $refItem = $listItem->getRefItem(); |
| 139 | 138 | unset( $listItems[$listItem->getId()] ); |
| 140 | - } |
|
| 141 | - else |
|
| 139 | + } else |
|
| 142 | 140 | { |
| 143 | 141 | $listItem = $manager->createListItem()->setType( $listtype ); |
| 144 | 142 | $refItem = $refManager->create()->setType( $type ); |
@@ -64,8 +64,7 @@ |
||
| 64 | 64 | { |
| 65 | 65 | $item = $propMap[$value][$type]; |
| 66 | 66 | $items->remove( $item->getId() ); |
| 67 | - } |
|
| 68 | - else |
|
| 67 | + } else |
|
| 69 | 68 | { |
| 70 | 69 | $item = $manager->createPropertyItem()->setType( $type ); |
| 71 | 70 | } |