@@ -175,8 +175,7 @@ discard block |
||
175 | 175 | $newMedia->image->cropThumbnailImage( (int) $width, (int) $height ); |
176 | 176 | // see https://www.php.net/manual/en/imagick.cropthumbnailimage.php#106710 |
177 | 177 | $newMedia->image->setImagePage( 0, 0, 0, 0 ); |
178 | - } |
|
179 | - else |
|
178 | + } else |
|
180 | 179 | { |
181 | 180 | $newMedia->image->resizeImage( $width, $height, \Imagick::FILTER_CUBIC, 0.8 ); |
182 | 181 | } |
@@ -228,8 +227,7 @@ discard block |
||
228 | 227 | $wmimage = clone self::$wmimg; |
229 | 228 | $wmimage->resizeImage( $ww, $wh, \Imagick::FILTER_CUBIC, 0.8 ); |
230 | 229 | self::$wmimages[$ww . 'x' . $wh] = $wmimage; |
231 | - } |
|
232 | - else |
|
230 | + } else |
|
233 | 231 | { |
234 | 232 | $wmimage = self::$wmimages[$ww . 'x' . $wh]; |
235 | 233 | } |
@@ -66,7 +66,9 @@ discard block |
||
66 | 66 | $this->removeItems( $item->getId(), 'catalog/lists', 'catalog', 'text' ); |
67 | 67 | $this->removeListItems( $item->getId(), 'catalog/lists', 'product' ); |
68 | 68 | } |
69 | - catch( \Exception $e ) {; } // If no root node was already inserted into the database |
|
69 | + catch( \Exception $e ) |
|
70 | + { |
|
71 | +; } // If no root node was already inserted into the database |
|
70 | 72 | |
71 | 73 | $search = $manager->filter(); |
72 | 74 | $search->setConditions( $search->compare( '=~', 'catalog.code', 'demo-' ) ); |
@@ -106,8 +108,7 @@ discard block |
||
106 | 108 | } |
107 | 109 | |
108 | 110 | $this->status( 'added' ); |
109 | - } |
|
110 | - else |
|
111 | + } else |
|
111 | 112 | { |
112 | 113 | $this->status( 'removed' ); |
113 | 114 | } |
@@ -173,7 +173,7 @@ |
||
173 | 173 | $manager = \Aimeos\MShop::create( $context, 'attribute' ); |
174 | 174 | $refItem = $manager->find( $refItem->getCode(), [], $domain, $refItem->getType() ); |
175 | 175 | } |
176 | - catch( \Aimeos\MShop\Exception $e ) { ; } // attribute doesn't exist yet |
|
176 | + catch( \Aimeos\MShop\Exception $e ) {; } // attribute doesn't exist yet |
|
177 | 177 | |
178 | 178 | $refItem = $this->addRefItems( $refItem, $data ); |
179 | 179 | $item->addListItem( 'attribute', $listItem, $refItem ); |
@@ -81,8 +81,7 @@ discard block |
||
81 | 81 | { |
82 | 82 | $this->addDemoData(); |
83 | 83 | $this->status( 'added' ); |
84 | - } |
|
85 | - else |
|
84 | + } else |
|
86 | 85 | { |
87 | 86 | $this->status( 'removed' ); |
88 | 87 | } |
@@ -173,7 +172,9 @@ discard block |
||
173 | 172 | $manager = \Aimeos\MShop::create( $context, 'attribute' ); |
174 | 173 | $refItem = $manager->find( $refItem->getCode(), [], $domain, $refItem->getType() ); |
175 | 174 | } |
176 | - catch( \Aimeos\MShop\Exception $e ) { ; } // attribute doesn't exist yet |
|
175 | + catch( \Aimeos\MShop\Exception $e ) |
|
176 | + { |
|
177 | +; } // attribute doesn't exist yet |
|
177 | 178 | |
178 | 179 | $refItem = $this->addRefItems( $refItem, $data ); |
179 | 180 | $item->addListItem( 'attribute', $listItem, $refItem ); |
@@ -349,7 +349,8 @@ |
||
349 | 349 | { |
350 | 350 | $stockManager->decrease( [$item->getProductId() => $how * -1 * $item->getQuantity()], $item->getStockType() ); |
351 | 351 | |
352 | - switch( $item->getType() ) { |
|
352 | + switch( $item->getType() ) |
|
353 | + { |
|
353 | 354 | case 'default': |
354 | 355 | $this->updateStockBundle( $item->getProductId(), $item->getStockType() ); break; |
355 | 356 | case 'select': |
@@ -140,8 +140,7 @@ |
||
140 | 140 | foreach( $cond->getExpressions() as $expr ) { |
141 | 141 | $list = array_merge( $list, $this->getProductIds( $expr ) ); |
142 | 142 | } |
143 | - } |
|
144 | - elseif( $cond instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface ) |
|
143 | + } elseif( $cond instanceof \Aimeos\MW\Criteria\Expression\Compare\Iface ) |
|
145 | 144 | { |
146 | 145 | if( $cond->getName() === 'stock.productid' && $cond->getOperator() === '==' ) { |
147 | 146 | $list = array_merge( $list, (array) $cond->getValue() ); |
@@ -97,10 +97,14 @@ |
||
97 | 97 | $item->setPosition( $dataset['position'] ); |
98 | 98 | } |
99 | 99 | |
100 | - try { |
|
100 | + try |
|
101 | + { |
|
101 | 102 | $pluginManager->save( $item ); |
102 | 103 | $num++; |
103 | - } catch( \Exception $e ) {; } // if plugin configuration was already available |
|
104 | + } |
|
105 | + catch( \Exception $e ) |
|
106 | + { |
|
107 | +; } // if plugin configuration was already available |
|
104 | 108 | } |
105 | 109 | |
106 | 110 | $this->status( $num > 0 ? $num . '/' . $total : 'OK' ); |
@@ -81,7 +81,7 @@ |
||
81 | 81 | try { |
82 | 82 | $domainManager->save( $type ); |
83 | 83 | $num++; |
84 | - } catch( \Exception $e ) { ; } // if type was already available |
|
84 | + } catch( \Exception $e ) {; } // if type was already available |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | $this->status( $num > 0 ? $num . '/' . $total : 'OK' ); |
@@ -78,10 +78,14 @@ |
||
78 | 78 | $type->setLabel( $dataset['label'] ); |
79 | 79 | $type->setStatus( $dataset['status'] ); |
80 | 80 | |
81 | - try { |
|
81 | + try |
|
82 | + { |
|
82 | 83 | $domainManager->save( $type ); |
83 | 84 | $num++; |
84 | - } catch( \Exception $e ) { ; } // if type was already available |
|
85 | + } |
|
86 | + catch( \Exception $e ) |
|
87 | + { |
|
88 | +; } // if type was already available |
|
85 | 89 | } |
86 | 90 | |
87 | 91 | $this->status( $num > 0 ? $num . '/' . $total : 'OK' ); |
@@ -55,7 +55,7 @@ |
||
55 | 55 | $manager->save( $item ); |
56 | 56 | $num++; |
57 | 57 | } |
58 | - catch( \Exception $e ) { ; } // if attribute was already available |
|
58 | + catch( \Exception $e ) {; } // if attribute was already available |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | $this->status( $num > 0 ? $num . '/' . $total : 'OK' ); |
@@ -55,7 +55,9 @@ |
||
55 | 55 | $manager->save( $item ); |
56 | 56 | $num++; |
57 | 57 | } |
58 | - catch( \Exception $e ) { ; } // if attribute was already available |
|
58 | + catch( \Exception $e ) |
|
59 | + { |
|
60 | +; } // if attribute was already available |
|
59 | 61 | } |
60 | 62 | |
61 | 63 | $this->status( $num > 0 ? $num . '/' . $total : 'OK' ); |
@@ -173,9 +173,13 @@ |
||
173 | 173 | |
174 | 174 | foreach( $testdata[$domain] as $entry ) |
175 | 175 | { |
176 | - try { |
|
176 | + try |
|
177 | + { |
|
177 | 178 | $manager->save( $manager->create()->fromArray( $entry ), false ); |
178 | - } catch( \Exception $e ) {} // Duplicate entry |
|
179 | + } |
|
180 | + catch( \Exception $e ) |
|
181 | + { |
|
182 | +} // Duplicate entry |
|
179 | 183 | } |
180 | 184 | } |
181 | 185 | } |