@@ -196,8 +196,7 @@ discard block |
||
| 196 | 196 | $ratio = ( $w < $h ? $width / $w : $height / $h ); |
| 197 | 197 | $newHeight = (int) $h * $ratio; |
| 198 | 198 | $newWidth = (int) $w * $ratio; |
| 199 | - } |
|
| 200 | - else |
|
| 199 | + } else |
|
| 201 | 200 | { |
| 202 | 201 | list( $newWidth, $newHeight ) = $this->getSizeFitted( $w, $h, $width, $height ); |
| 203 | 202 | |
@@ -261,8 +260,7 @@ discard block |
||
| 261 | 260 | |
| 262 | 261 | imagedestroy( $result ); |
| 263 | 262 | $newMedia->image = $newImage; |
| 264 | - } |
|
| 265 | - else |
|
| 263 | + } else |
|
| 266 | 264 | { |
| 267 | 265 | $newMedia->image = $result; |
| 268 | 266 | } |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | $item = $item->setId( null )->fromArray( $dataset ); |
| 51 | 51 | $manager->save( $item ); |
| 52 | 52 | } |
| 53 | - catch( \Exception $e ) { ; } // if attribute was already available |
|
| 53 | + catch( \Exception $e ) {; } // if attribute was already available |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | } |
@@ -50,7 +50,9 @@ |
||
| 50 | 50 | $item = $item->setId( null )->fromArray( $dataset ); |
| 51 | 51 | $manager->save( $item ); |
| 52 | 52 | } |
| 53 | - catch( \Exception $e ) { ; } // if attribute was already available |
|
| 53 | + catch( \Exception $e ) |
|
| 54 | + { |
|
| 55 | +; } // if attribute was already available |
|
| 54 | 56 | } |
| 55 | 57 | } |
| 56 | 58 | } |
@@ -85,9 +85,13 @@ |
||
| 85 | 85 | $item->setPosition( $dataset['position'] ); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - try { |
|
| 88 | + try |
|
| 89 | + { |
|
| 89 | 90 | $pluginManager->save( $item ); |
| 90 | - } catch( \Exception $e ) {; } // if plugin configuration was already available |
|
| 91 | + } |
|
| 92 | + catch( \Exception $e ) |
|
| 93 | + { |
|
| 94 | +; } // if plugin configuration was already available |
|
| 91 | 95 | } |
| 92 | 96 | } |
| 93 | 97 | } |
@@ -46,21 +46,18 @@ |
||
| 46 | 46 | { |
| 47 | 47 | $options[$name] = (array) $options[$name]; |
| 48 | 48 | $options[$name][] = substr( $option, $pos + 1 ); |
| 49 | - } |
|
| 50 | - else |
|
| 49 | + } else |
|
| 51 | 50 | { |
| 52 | 51 | $options[$name] = substr( $option, $pos + 1 ); |
| 53 | 52 | } |
| 54 | 53 | |
| 55 | 54 | unset( $params[$key] ); |
| 56 | - } |
|
| 57 | - else |
|
| 55 | + } else |
|
| 58 | 56 | { |
| 59 | 57 | printf( "Invalid option \"%1\$s\"\n", $option ); |
| 60 | 58 | usage(); |
| 61 | 59 | } |
| 62 | - } |
|
| 63 | - elseif( $option[0] === '-' ) |
|
| 60 | + } elseif( $option[0] === '-' ) |
|
| 64 | 61 | { |
| 65 | 62 | $options[$option[1]] = substr( $option, 1 ); |
| 66 | 63 | unset( $params[$key] ); |
@@ -138,9 +138,12 @@ |
||
| 138 | 138 | { |
| 139 | 139 | foreach( $data['customer/group'] as $entry ) |
| 140 | 140 | { |
| 141 | - try { |
|
| 141 | + try |
|
| 142 | + { |
|
| 142 | 143 | $groupManager->save( $groupManager->find( $entry['customer.group.code'] )->fromArray( $entry ) ); |
| 143 | - } catch( \Exception $e ) { |
|
| 144 | + } |
|
| 145 | + catch( \Exception $e ) |
|
| 146 | + { |
|
| 144 | 147 | $groupManager->save( $groupManager->create()->fromArray( $entry ), false ); |
| 145 | 148 | } |
| 146 | 149 | } |
@@ -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; |