@@ -294,8 +294,7 @@ |
||
| 294 | 294 | $map[$item->getParentId()][$item->getPosition()] = $item; |
| 295 | 295 | |
| 296 | 296 | $subProducts = []; |
| 297 | - } |
|
| 298 | - else |
|
| 297 | + } else |
|
| 299 | 298 | { // in case it's a sub-product |
| 300 | 299 | $subProducts[$item->getPosition()] = $item; |
| 301 | 300 | } |
@@ -296,8 +296,7 @@ |
||
| 296 | 296 | } ); |
| 297 | 297 | |
| 298 | 298 | $service->setId( null )->setAttributeItems( $attrItems->setId( null ) ); |
| 299 | - } |
|
| 300 | - else |
|
| 299 | + } else |
|
| 301 | 300 | { |
| 302 | 301 | unset( $map[$type][$key] ); |
| 303 | 302 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | $this->info( 'Creating test schema', 'vv' ); |
| 17 | 17 | |
| 18 | - $this->db( 'db-test' )->table( 'mshop_test', function( \Aimeos\Upscheme\Schema\Table $table ) { |
|
| 18 | + $this->db( 'db-test' )->table( 'mshop_test', function( \Aimeos\Upscheme\Schema\Table $table ) { |
|
| 19 | 19 | |
| 20 | 20 | $table->engine = 'InnoDB'; |
| 21 | 21 | |
@@ -55,9 +55,12 @@ |
||
| 55 | 55 | |
| 56 | 56 | foreach( $testdata['group'] as $entry ) |
| 57 | 57 | { |
| 58 | - try { |
|
| 58 | + try |
|
| 59 | + { |
|
| 59 | 60 | $manager->save( $manager->find( $entry['group.code'] )->fromArray( $entry ) ); |
| 60 | - } catch( \Exception $e ) { |
|
| 61 | + } |
|
| 62 | + catch( \Exception $e ) |
|
| 63 | + { |
|
| 61 | 64 | $manager->save( $manager->create()->fromArray( $entry ), false ); |
| 62 | 65 | } |
| 63 | 66 | } |
@@ -620,9 +620,13 @@ discard block |
||
| 620 | 620 | |
| 621 | 621 | if( empty( $item->getInvoiceNumber() ) && $item->getStatusPayment() >= \Aimeos\MShop\Order\Item\Base::PAY_PENDING ) |
| 622 | 622 | { |
| 623 | - try { |
|
| 623 | + try |
|
| 624 | + { |
|
| 624 | 625 | $item->setInvoiceNumber( $this->createInvoiceNumber( $item ) ); |
| 625 | - } catch( \Exception $e ) { // redo on transaction deadlock |
|
| 626 | + } |
|
| 627 | + catch( \Exception $e ) |
|
| 628 | + { |
|
| 629 | +// redo on transaction deadlock |
|
| 626 | 630 | $item->setInvoiceNumber( $this->createInvoiceNumber( $item ) ); |
| 627 | 631 | } |
| 628 | 632 | } |
@@ -673,8 +677,7 @@ discard block |
||
| 673 | 677 | */ |
| 674 | 678 | $path = 'mshop/order/manager/insert'; |
| 675 | 679 | $sql = $this->addSqlColumns( array_keys( $columns ), $this->getSqlConfig( $path ) ); |
| 676 | - } |
|
| 677 | - else |
|
| 680 | + } else |
|
| 678 | 681 | { |
| 679 | 682 | /** mshop/order/manager/update/mysql |
| 680 | 683 | * Updates an existing order record in the database |
@@ -344,7 +344,8 @@ |
||
| 344 | 344 | { |
| 345 | 345 | $stockManager->decrease( [$item->getProductId() => -1 * $how * $item->getQuantity()], $item->getStockType() ); |
| 346 | 346 | |
| 347 | - switch( $item->getType() ) { |
|
| 347 | + switch( $item->getType() ) |
|
| 348 | + { |
|
| 348 | 349 | case 'default': |
| 349 | 350 | $this->updateStockBundle( $item->getParentProductId(), $item->getStockType() ); break; |
| 350 | 351 | case 'select': |
@@ -137,8 +137,7 @@ |
||
| 137 | 137 | $msg = $this->context()->translate( 'mshop', 'Unable to open file "%1$s"' ); |
| 138 | 138 | throw new \RuntimeException( sprintf( $msg, $file ) ); |
| 139 | 139 | } |
| 140 | - } |
|
| 141 | - else |
|
| 140 | + } else |
|
| 142 | 141 | { |
| 143 | 142 | $fh = $this->context()->fs( $fsname )->reads( $file ); |
| 144 | 143 | } |
@@ -56,9 +56,9 @@ |
||
| 56 | 56 | if( $this->call( 'filterPreviews', $image, $maxwidth, $maxheight, $force ) ) |
| 57 | 57 | { |
| 58 | 58 | $file = match( $force ) { |
| 59 | - 0 => (clone $image)->scaleDown( $maxwidth, $maxheight ), |
|
| 60 | - 1 => (clone $image)->pad( $maxwidth, $maxheight, $bg, 'center' ), |
|
| 61 | - 2 => (clone $image)->cover( $maxwidth, $maxheight ) |
|
| 59 | + 0 => ( clone $image )->scaleDown( $maxwidth, $maxheight ), |
|
| 60 | + 1 => ( clone $image )->pad( $maxwidth, $maxheight, $bg, 'center' ), |
|
| 61 | + 2 => ( clone $image )->cover( $maxwidth, $maxheight ) |
|
| 62 | 62 | }; |
| 63 | 63 | |
| 64 | 64 | $list[$file->width()] = $file; |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | $this->removeRefItems( map( $item ), $domains ); |
| 129 | 129 | $manager->save( $item ); |
| 130 | 130 | } |
| 131 | - catch( \Exception $e ) { ; } // If no root node was already inserted into the database |
|
| 131 | + catch( \Exception $e ) {; } // If no root node was already inserted into the database |
|
| 132 | 132 | |
| 133 | 133 | $filter = $manager->filter() |
| 134 | 134 | ->add( 'catalog.code', '=~', 'demo-' ) |
@@ -77,9 +77,12 @@ discard block |
||
| 77 | 77 | $context = $this->context(); |
| 78 | 78 | $manager = \Aimeos\MShop::create( $context, 'catalog' ); |
| 79 | 79 | |
| 80 | - try { |
|
| 80 | + try |
|
| 81 | + { |
|
| 81 | 82 | $item = $manager->getTree( null, ['media', 'text'], \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE ); |
| 82 | - } catch( \Exception $e ) { |
|
| 83 | + } |
|
| 84 | + catch( \Exception $e ) |
|
| 85 | + { |
|
| 83 | 86 | $item = $manager->insert( $manager->create()->fromArray( $data ) ); |
| 84 | 87 | } |
| 85 | 88 | |
@@ -128,7 +131,9 @@ discard block |
||
| 128 | 131 | $this->removeRefItems( map( $item ), $domains ); |
| 129 | 132 | $manager->save( $item ); |
| 130 | 133 | } |
| 131 | - catch( \Exception $e ) { ; } // If no root node was already inserted into the database |
|
| 134 | + catch( \Exception $e ) |
|
| 135 | + { |
|
| 136 | +; } // If no root node was already inserted into the database |
|
| 132 | 137 | |
| 133 | 138 | $filter = $manager->filter() |
| 134 | 139 | ->add( 'catalog.code', '=~', 'demo-' ) |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | |
| 88 | 88 | try { |
| 89 | 89 | $refItem = $refManager->find( $refItem->getCode(), [], $item->getResourceType(), $refItem->getType() ); |
| 90 | - } catch( \Exception $e ) { ; } // if not found, use the new item |
|
| 90 | + } catch( \Exception $e ) {; } // if not found, use the new item |
|
| 91 | 91 | |
| 92 | 92 | $refItem = $this->addRefItems( $refItem, $data ); |
| 93 | 93 | $item->addListItem( 'attribute', $listItem, $refItem ); |
@@ -85,9 +85,13 @@ |
||
| 85 | 85 | $listItem = $manager->createListItem()->setPosition( $idx )->fromArray( $data ); |
| 86 | 86 | $refItem = $refManager->create()->fromArray( $data ); |
| 87 | 87 | |
| 88 | - try { |
|
| 88 | + try |
|
| 89 | + { |
|
| 89 | 90 | $refItem = $refManager->find( $refItem->getCode(), [], $item->getResourceType(), $refItem->getType() ); |
| 90 | - } catch( \Exception $e ) { ; } // if not found, use the new item |
|
| 91 | + } |
|
| 92 | + catch( \Exception $e ) |
|
| 93 | + { |
|
| 94 | +; } // if not found, use the new item |
|
| 91 | 95 | |
| 92 | 96 | $refItem = $this->addRefItems( $refItem, $data ); |
| 93 | 97 | $item->addListItem( 'attribute', $listItem, $refItem ); |