@@ -95,8 +95,7 @@ discard block |
||
| 95 | 95 | $files[] = $entry->getPathname(); |
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | - } |
|
| 99 | - else |
|
| 98 | + } else |
|
| 100 | 99 | { |
| 101 | 100 | $files[] = $location; |
| 102 | 101 | } |
@@ -240,7 +239,9 @@ discard block |
||
| 240 | 239 | |
| 241 | 240 | return $currentid; |
| 242 | 241 | } |
| 243 | - catch( \Aimeos\MShop\Exception $e ) {} // not found, create new |
|
| 242 | + catch( \Aimeos\MShop\Exception $e ) |
|
| 243 | + { |
|
| 244 | +} // not found, create new |
|
| 244 | 245 | } |
| 245 | 246 | |
| 246 | 247 | $item = $this->process( $manager->create(), $node ); |
@@ -278,13 +279,11 @@ discard block |
||
| 278 | 279 | |
| 279 | 280 | $currentid = $this->importNode( $node, $domains, $parentid, $childMap ); |
| 280 | 281 | $total++; |
| 281 | - } |
|
| 282 | - elseif( $xml->nodeType === \XMLReader::ELEMENT && $xml->name === 'catalog' ) |
|
| 282 | + } elseif( $xml->nodeType === \XMLReader::ELEMENT && $xml->name === 'catalog' ) |
|
| 283 | 283 | { |
| 284 | 284 | $this->importTree( $xml, $domains, $currentid, $childMap ); |
| 285 | 285 | $childMap = []; |
| 286 | - } |
|
| 287 | - elseif( $xml->nodeType === \XMLReader::END_ELEMENT && $xml->name === 'catalog' ) |
|
| 286 | + } elseif( $xml->nodeType === \XMLReader::END_ELEMENT && $xml->name === 'catalog' ) |
|
| 288 | 287 | { |
| 289 | 288 | \Aimeos\MShop::create( $this->getContext(), 'catalog' )->delete( $map ); |
| 290 | 289 | break; |
@@ -591,8 +591,7 @@ |
||
| 591 | 591 | { |
| 592 | 592 | $manager->moveItem( $item->getId(), $item->getParentId(), $parentid ); |
| 593 | 593 | $item = $manager->save( $item ); |
| 594 | - } |
|
| 595 | - else |
|
| 594 | + } else |
|
| 596 | 595 | { |
| 597 | 596 | $item = $manager->insertItem( $item, $parentid ); |
| 598 | 597 | } |
@@ -82,8 +82,7 @@ discard block |
||
| 82 | 82 | foreach( $manager->search( $search ) as $item ) { |
| 83 | 83 | $this->listTypes[$item->getCode()] = $item->getCode(); |
| 84 | 84 | } |
| 85 | - } |
|
| 86 | - else |
|
| 85 | + } else |
|
| 87 | 86 | { |
| 88 | 87 | $this->listTypes = array_flip( $this->listTypes ); |
| 89 | 88 | } |
@@ -147,8 +146,7 @@ discard block |
||
| 147 | 146 | { |
| 148 | 147 | $listItem = $listMap[$code][$attrType][$listtype]; |
| 149 | 148 | unset( $listItems[$listItem->getId()] ); |
| 150 | - } |
|
| 151 | - else |
|
| 149 | + } else |
|
| 152 | 150 | { |
| 153 | 151 | $listItem = $listManager->create()->setType( $listtype ); |
| 154 | 152 | } |
@@ -124,9 +124,11 @@ discard block |
||
| 124 | 124 | } |
| 125 | 125 | catch( \Exception $e ) |
| 126 | 126 | { |
| 127 | - if( $e->getCode() < 1 ) // not a soft error |
|
| 127 | + if( $e->getCode() < 1 ) { |
|
| 128 | + // not a soft error |
|
| 128 | 129 | { |
| 129 | 130 | $item->setReason( \Aimeos\MShop\Subscription\Item\Iface::REASON_PAYMENT ); |
| 131 | + } |
|
| 130 | 132 | |
| 131 | 133 | if( $end ) { |
| 132 | 134 | $item->setDateEnd( date_create()->format( 'Y-m-d' ) ); |
@@ -228,9 +230,12 @@ discard block |
||
| 228 | 230 | { |
| 229 | 231 | foreach( $codes as $code ) |
| 230 | 232 | { |
| 231 | - try { |
|
| 233 | + try |
|
| 234 | + { |
|
| 232 | 235 | $basket->addCoupon( $code ); |
| 233 | - } catch( \Aimeos\MShop\Plugin\Provider\Exception | \Aimeos\MShop\Coupon\Exception $e ) { |
|
| 236 | + } |
|
| 237 | + catch( \Aimeos\MShop\Plugin\Provider\Exception | \Aimeos\MShop\Coupon\Exception $e ) |
|
| 238 | + { |
|
| 234 | 239 | $basket->deleteCoupon( $code ); |
| 235 | 240 | } |
| 236 | 241 | } |
@@ -349,7 +354,9 @@ discard block |
||
| 349 | 354 | $context->setUserId( $baseItem->getCustomerId() ); |
| 350 | 355 | $context->setGroupIds( $customerItem->getGroups() ); |
| 351 | 356 | } |
| 352 | - catch( \Exception $e ) {} // Subscription without account |
|
| 357 | + catch( \Exception $e ) |
|
| 358 | + { |
|
| 359 | +} // Subscription without account |
|
| 353 | 360 | |
| 354 | 361 | return $context; |
| 355 | 362 | } |
@@ -562,9 +562,11 @@ |
||
| 562 | 562 | |
| 563 | 563 | $map = $this->getMappedChunk( $list, $mapping ); |
| 564 | 564 | |
| 565 | - if( isset( $map[0] ) ) // there can only be one chunk for the base product data |
|
| 565 | + if( isset( $map[0] ) ) { |
|
| 566 | + // there can only be one chunk for the base product data |
|
| 566 | 567 | { |
| 567 | 568 | $type = $this->checkType( $this->getValue( $map[0], 'product.type', $product->getType() ) ); |
| 569 | + } |
|
| 568 | 570 | $map[0]['product.config'] = json_decode( $map[0]['product.config'] ?? '[]', true ) ?: []; |
| 569 | 571 | |
| 570 | 572 | $product = $product->fromArray( $map[0], true ); |