@@ -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': |
@@ -196,8 +196,7 @@ |
||
| 196 | 196 | { |
| 197 | 197 | $item = $this->deletePreviews( $item, $fsname ); |
| 198 | 198 | $item = $this->addImages( $item, $media, $name, $fsname ); |
| 199 | - } |
|
| 200 | - else |
|
| 199 | + } else |
|
| 201 | 200 | { |
| 202 | 201 | $mimetype = $this->getMimeType( $media, 'files' ); |
| 203 | 202 | $item = $item->setPreviews( [1 => $this->getMimeIcon( $mimetype, $fsname )] ) |
@@ -482,7 +482,7 @@ |
||
| 482 | 482 | $siteId = $this->context->locale()->getSiteId(); |
| 483 | 483 | |
| 484 | 484 | // the "d" after {siteid} is the required extension for Windows (no dots at the and allowed) |
| 485 | - return "${siteId}d/${type}/${filename[0]}/${filename[1]}/${filename}${ext}"; |
|
| 485 | + return "${siteid}d/${type}/${filename[0]}/${filename[1]}/${filename}${ext}"; |
|
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | |
@@ -69,9 +69,12 @@ |
||
| 69 | 69 | */ |
| 70 | 70 | public function execute() : \Aimeos\MW\DB\Result\Iface |
| 71 | 71 | { |
| 72 | - try { |
|
| 72 | + try |
|
| 73 | + { |
|
| 73 | 74 | $result = $this->getConnection()->getRawObject()->getWrappedConnection()->query( $this->sql ); |
| 74 | - } catch( \Doctrine\DBAL\Driver\Exception $e ) { |
|
| 75 | + } |
|
| 76 | + catch( \Doctrine\DBAL\Driver\Exception $e ) |
|
| 77 | + { |
|
| 75 | 78 | throw new \Aimeos\MW\DB\Exception( $e->getMessage() . ': ' . $this->sql, $e->getCode() ); |
| 76 | 79 | } |
| 77 | 80 | |
@@ -71,9 +71,12 @@ |
||
| 71 | 71 | */ |
| 72 | 72 | public function execute() : \Aimeos\MW\DB\Result\Iface |
| 73 | 73 | { |
| 74 | - try { |
|
| 74 | + try |
|
| 75 | + { |
|
| 75 | 76 | $result = $this->exec(); |
| 76 | - } catch( \Doctrine\DBAL\Driver\Exception $e ) { |
|
| 77 | + } |
|
| 78 | + catch( \Doctrine\DBAL\Driver\Exception $e ) |
|
| 79 | + { |
|
| 77 | 80 | throw new \Aimeos\MW\DB\Exception( $e->getMessage() . ': ' . $this->sql . map( $this->binds )->col( 0 )->toJson(), $e->getCode() ); |
| 78 | 81 | } |
| 79 | 82 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | switch( $type ) |
| 118 | 118 | { |
| 119 | 119 | case \Aimeos\MW\DB\Statement\Base::PARAM_NULL: |
| 120 | - $dbaltype = \Doctrine\DBAL\ParameterType::NULL; break; |
|
| 120 | + $dbaltype = \Doctrine\DBAL\ParameterType::null; break; |
|
| 121 | 121 | case \Aimeos\MW\DB\Statement\Base::PARAM_BOOL: |
| 122 | 122 | $dbaltype = \Doctrine\DBAL\ParameterType::BOOLEAN; break; |
| 123 | 123 | case \Aimeos\MW\DB\Statement\Base::PARAM_INT: |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | if( is_null( $value ) ) { |
| 136 | - $dbaltype = \Doctrine\DBAL\ParameterType::NULL; |
|
| 136 | + $dbaltype = \Doctrine\DBAL\ParameterType::null; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | return $dbaltype; |
@@ -50,9 +50,12 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function affectedRows() : int |
| 52 | 52 | { |
| 53 | - try { |
|
| 53 | + try |
|
| 54 | + { |
|
| 54 | 55 | return $this->result->rowCount(); |
| 55 | - } catch( \Doctrine\DBAL\Driver\Exception $e ) { |
|
| 56 | + } |
|
| 57 | + catch( \Doctrine\DBAL\Driver\Exception $e ) |
|
| 58 | + { |
|
| 56 | 59 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode() ); |
| 57 | 60 | } |
| 58 | 61 | } |
@@ -90,9 +93,12 @@ discard block |
||
| 90 | 93 | */ |
| 91 | 94 | public function finish() : Iface |
| 92 | 95 | { |
| 93 | - try { |
|
| 96 | + try |
|
| 97 | + { |
|
| 94 | 98 | $this->result->free(); |
| 95 | - } catch( \Doctrine\DBAL\Driver\Exception $e ) { |
|
| 99 | + } |
|
| 100 | + catch( \Doctrine\DBAL\Driver\Exception $e ) |
|
| 101 | + { |
|
| 96 | 102 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode() ); |
| 97 | 103 | } |
| 98 | 104 | |
@@ -221,7 +221,7 @@ |
||
| 221 | 221 | |
| 222 | 222 | try { |
| 223 | 223 | $localeItemManager->save( $localeItem ); |
| 224 | - } catch( \Aimeos\MW\DB\Exception $e ) { ; } // if locale combination was already available |
|
| 224 | + } catch( \Aimeos\MW\DB\Exception $e ) {; } // if locale combination was already available |
|
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | } |
@@ -77,7 +77,9 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | $localeManager->save( $localeItem, false ); |
| 79 | 79 | } |
| 80 | - catch( \Aimeos\MW\DB\Exception $e ) {} // already in the database |
|
| 80 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
| 81 | + { |
|
| 82 | +} // already in the database |
|
| 81 | 83 | } |
| 82 | 84 | |
| 83 | 85 | |
@@ -219,9 +221,13 @@ discard block |
||
| 219 | 221 | $localeItem->setPosition( $dataset['pos'] ); |
| 220 | 222 | $localeItem->setStatus( $dataset['status'] ); |
| 221 | 223 | |
| 222 | - try { |
|
| 224 | + try |
|
| 225 | + { |
|
| 223 | 226 | $localeItemManager->save( $localeItem ); |
| 224 | - } catch( \Aimeos\MW\DB\Exception $e ) { ; } // if locale combination was already available |
|
| 227 | + } |
|
| 228 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
| 229 | + { |
|
| 230 | +; } // if locale combination was already available |
|
| 225 | 231 | } |
| 226 | 232 | } |
| 227 | 233 | } |
@@ -59,8 +59,7 @@ discard block |
||
| 59 | 59 | foreach( $value as $key => $product ) { |
| 60 | 60 | $value[$key] = $this->updatePrice( $product ); |
| 61 | 61 | } |
| 62 | - } |
|
| 63 | - else |
|
| 62 | + } else |
|
| 64 | 63 | { |
| 65 | 64 | $value = $this->updatePrice( $value ); |
| 66 | 65 | } |
@@ -139,8 +138,7 @@ discard block |
||
| 139 | 138 | { |
| 140 | 139 | $priceManager = \Aimeos\MShop::create( $this->context(), 'price' ); |
| 141 | 140 | |
| 142 | - $sortFcn = function( $a, $b ) use( $priceManager, $attrQtys ) |
|
| 143 | - { |
|
| 141 | + $sortFcn = function( $a, $b ) use( $priceManager, $attrQtys ) { |
|
| 144 | 142 | if( ( $pricesA = $a->getRefItems( 'price', 'default', 'default' )->toArray() ) === [] ) { |
| 145 | 143 | return 1; |
| 146 | 144 | } |
@@ -203,8 +201,7 @@ discard block |
||
| 203 | 201 | { |
| 204 | 202 | $list = $this->sortByPrice( $list, $attrQtys ); |
| 205 | 203 | $priceItem = $this->addPrices( $priceItem, $list, $attrQtys, (int) $prodConf[$type] ); |
| 206 | - } |
|
| 207 | - else |
|
| 204 | + } else |
|
| 208 | 205 | { |
| 209 | 206 | $priceItem = $this->addPrices( $priceItem, $list, $attrQtys, 0 ); |
| 210 | 207 | } |
@@ -165,7 +165,7 @@ |
||
| 165 | 165 | $manager = \Aimeos\MShop::create( $context, 'attribute' ); |
| 166 | 166 | $refItem = $manager->find( $refItem->getCode(), [], $domain, $refItem->getType() ); |
| 167 | 167 | } |
| 168 | - catch( \Exception $e ) { ; } // attribute doesn't exist yet |
|
| 168 | + catch( \Exception $e ) {; } // attribute doesn't exist yet |
|
| 169 | 169 | |
| 170 | 170 | $refItem = $this->addRefItems( $refItem, $data ); |
| 171 | 171 | $item->addListItem( 'attribute', $listItem, $refItem ); |
@@ -165,7 +165,9 @@ |
||
| 165 | 165 | $manager = \Aimeos\MShop::create( $context, 'attribute' ); |
| 166 | 166 | $refItem = $manager->find( $refItem->getCode(), [], $domain, $refItem->getType() ); |
| 167 | 167 | } |
| 168 | - catch( \Exception $e ) { ; } // attribute doesn't exist yet |
|
| 168 | + catch( \Exception $e ) |
|
| 169 | + { |
|
| 170 | +; } // attribute doesn't exist yet |
|
| 169 | 171 | |
| 170 | 172 | $refItem = $this->addRefItems( $refItem, $data ); |
| 171 | 173 | $item->addListItem( 'attribute', $listItem, $refItem ); |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | $this->removeItems( $item->getId(), 'catalog/lists', 'catalog', 'text' ); |
| 64 | 64 | $this->removeListItems( $item->getId(), 'catalog/lists', 'product' ); |
| 65 | 65 | } |
| 66 | - catch( \Exception $e ) { ; } // If no root node was already inserted into the database |
|
| 66 | + catch( \Exception $e ) {; } // If no root node was already inserted into the database |
|
| 67 | 67 | |
| 68 | 68 | $search = $manager->filter(); |
| 69 | 69 | $search->setConditions( $search->compare( '=~', 'catalog.code', 'demo-' ) ); |
@@ -63,7 +63,9 @@ |
||
| 63 | 63 | $this->removeItems( $item->getId(), 'catalog/lists', 'catalog', 'text' ); |
| 64 | 64 | $this->removeListItems( $item->getId(), 'catalog/lists', 'product' ); |
| 65 | 65 | } |
| 66 | - catch( \Exception $e ) { ; } // If no root node was already inserted into the database |
|
| 66 | + catch( \Exception $e ) |
|
| 67 | + { |
|
| 68 | +; } // If no root node was already inserted into the database |
|
| 67 | 69 | |
| 68 | 70 | $search = $manager->filter(); |
| 69 | 71 | $search->setConditions( $search->compare( '=~', 'catalog.code', 'demo-' ) ); |