@@ -155,8 +155,7 @@ |
||
| 155 | 155 | $files[] = $entry->getPathname(); |
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | - } |
|
| 159 | - else |
|
| 158 | + } else |
|
| 160 | 159 | { |
| 161 | 160 | $files[] = $location; |
| 162 | 161 | } |
@@ -75,7 +75,9 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | - catch( \Exception $e ) {; } // no translation found |
|
| 78 | + catch( \Exception $e ) |
|
| 79 | + { |
|
| 80 | +; } // no translation found |
|
| 79 | 81 | |
| 80 | 82 | return (string) $string; |
| 81 | 83 | } |
@@ -104,7 +106,9 @@ discard block |
||
| 104 | 106 | } |
| 105 | 107 | } |
| 106 | 108 | } |
| 107 | - catch( \Exception $e ) {; } // no translation found |
|
| 109 | + catch( \Exception $e ) |
|
| 110 | + { |
|
| 111 | +; } // no translation found |
|
| 108 | 112 | |
| 109 | 113 | if( $index > 0 ) { |
| 110 | 114 | return (string) $plural; |
@@ -108,9 +108,12 @@ |
||
| 108 | 108 | */ |
| 109 | 109 | public function scan( string $path = null ) : iterable |
| 110 | 110 | { |
| 111 | - try { |
|
| 111 | + try |
|
| 112 | + { |
|
| 112 | 113 | return new \DirectoryIterator( $this->resolve( $path ) ); |
| 113 | - } catch( \Exception $e ) { |
|
| 114 | + } |
|
| 115 | + catch( \Exception $e ) |
|
| 116 | + { |
|
| 114 | 117 | throw new Exception( $e->getMessage(), 0, $e ); |
| 115 | 118 | } |
| 116 | 119 | } |
@@ -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->exec(); |
| 74 | - } catch( \PDOException $e ) { |
|
| 75 | + } |
|
| 76 | + catch( \PDOException $e ) |
|
| 77 | + { |
|
| 75 | 78 | throw new \Aimeos\MW\DB\Exception( $e->getMessage() . ': ' . $this->sql, $e->getCode() ); |
| 76 | 79 | } |
| 77 | 80 | |
@@ -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->exec(); |
| 74 | - } catch( \PDOException $e ) { |
|
| 75 | + } |
|
| 76 | + catch( \PDOException $e ) |
|
| 77 | + { |
|
| 75 | 78 | throw new \Aimeos\MW\DB\Exception( $e->getMessage() . ': ' . $this->sql, $e->getCode() ); |
| 76 | 79 | } |
| 77 | 80 | |
@@ -51,9 +51,12 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function affectedRows() : int |
| 53 | 53 | { |
| 54 | - try { |
|
| 54 | + try |
|
| 55 | + { |
|
| 55 | 56 | return $this->statement->rowCount(); |
| 56 | - } catch( \PDOException $e ) { |
|
| 57 | + } |
|
| 58 | + catch( \PDOException $e ) |
|
| 59 | + { |
|
| 57 | 60 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
| 58 | 61 | } |
| 59 | 62 | } |
@@ -68,9 +71,12 @@ discard block |
||
| 68 | 71 | */ |
| 69 | 72 | public function fetch( int $style = \Aimeos\MW\DB\Result\Base::FETCH_ASSOC ) : ?array |
| 70 | 73 | { |
| 71 | - try { |
|
| 74 | + try |
|
| 75 | + { |
|
| 72 | 76 | return $this->statement->fetch( $style ? \PDO::FETCH_ASSOC : \PDO::FETCH_NUM ) ?: null; |
| 73 | - } catch( \PDOException $e ) { |
|
| 77 | + } |
|
| 78 | + catch( \PDOException $e ) |
|
| 79 | + { |
|
| 74 | 80 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
| 75 | 81 | } |
| 76 | 82 | } |
@@ -84,9 +90,12 @@ discard block |
||
| 84 | 90 | */ |
| 85 | 91 | public function finish() : Iface |
| 86 | 92 | { |
| 87 | - try { |
|
| 93 | + try |
|
| 94 | + { |
|
| 88 | 95 | $this->statement->closeCursor(); |
| 89 | - } catch( \PDOException $e ) { |
|
| 96 | + } |
|
| 97 | + catch( \PDOException $e ) |
|
| 98 | + { |
|
| 90 | 99 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
| 91 | 100 | } |
| 92 | 101 | |
@@ -101,9 +110,12 @@ discard block |
||
| 101 | 110 | */ |
| 102 | 111 | public function nextResult() : bool |
| 103 | 112 | { |
| 104 | - try { |
|
| 113 | + try |
|
| 114 | + { |
|
| 105 | 115 | return $this->statement->nextRowset(); |
| 106 | - } catch( \PDOException $e ) { |
|
| 116 | + } |
|
| 117 | + catch( \PDOException $e ) |
|
| 118 | + { |
|
| 107 | 119 | return false; |
| 108 | 120 | } |
| 109 | 121 | } |
@@ -53,8 +53,7 @@ discard block |
||
| 53 | 53 | foreach( $value as $key => $product ) { |
| 54 | 54 | $value[$key] = $this->updatePrice( $product ); |
| 55 | 55 | } |
| 56 | - } |
|
| 57 | - else |
|
| 56 | + } else |
|
| 58 | 57 | { |
| 59 | 58 | $value = $this->updatePrice( $value ); |
| 60 | 59 | } |
@@ -133,8 +132,7 @@ discard block |
||
| 133 | 132 | { |
| 134 | 133 | $priceManager = \Aimeos\MShop::create( $this->getContext(), 'price' ); |
| 135 | 134 | |
| 136 | - $sortFcn = function( $a, $b ) use( $priceManager, $attrQtys ) |
|
| 137 | - { |
|
| 135 | + $sortFcn = function( $a, $b ) use( $priceManager, $attrQtys ) { |
|
| 138 | 136 | if( ( $pricesA = $a->getRefItems( 'price', 'default', 'default' )->toArray() ) === [] ) { |
| 139 | 137 | return 1; |
| 140 | 138 | } |
@@ -197,8 +195,7 @@ discard block |
||
| 197 | 195 | { |
| 198 | 196 | $list = $this->sortByPrice( $list, $attrQtys ); |
| 199 | 197 | $priceItem = $this->addPrices( $priceItem, $list, $attrQtys, (int) $prodConf[$type] ); |
| 200 | - } |
|
| 201 | - else |
|
| 198 | + } else |
|
| 202 | 199 | { |
| 203 | 200 | $priceItem = $this->addPrices( $priceItem, $list, $attrQtys, 0 ); |
| 204 | 201 | } |
@@ -69,8 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | if( in_array( $op, $operators['combine'], true ) ) { |
| 71 | 71 | return $this->createCombineExpression( $op, (array) $value ); |
| 72 | - } |
|
| 73 | - else if( in_array( $op, $operators['compare'], true ) ) { |
|
| 72 | + } else if( in_array( $op, $operators['compare'], true ) ) { |
|
| 74 | 73 | return $this->createCompareExpression( $op, (array) $value ); |
| 75 | 74 | } |
| 76 | 75 | |
@@ -147,11 +146,9 @@ discard block |
||
| 147 | 146 | |
| 148 | 147 | if( in_array( $op, $operators['combine'], true ) ) { |
| 149 | 148 | $results[] = $this->createCombineExpression( $op, (array) $entry[$op] ); |
| 150 | - } |
|
| 151 | - else if( in_array( $op, $operators['compare'], true ) ) { |
|
| 149 | + } else if( in_array( $op, $operators['compare'], true ) ) { |
|
| 152 | 150 | $results[] = $this->createCompareExpression( $op, (array) $entry[$op] ); |
| 153 | - } |
|
| 154 | - else { |
|
| 151 | + } else { |
|
| 155 | 152 | throw new \Aimeos\MW\Common\Exception( sprintf( 'Invalid operator "%1$s"', $op ) ); |
| 156 | 153 | } |
| 157 | 154 | } |
@@ -74,8 +74,7 @@ |
||
| 74 | 74 | SELECT * FROM mw_mqueue_test WHERE queue = ? AND cname = ? AND rtime = ? |
| 75 | 75 | ORDER BY id LIMIT 1 |
| 76 | 76 | '; |
| 77 | - } |
|
| 78 | - else |
|
| 77 | + } else |
|
| 79 | 78 | { |
| 80 | 79 | $config['sql']['reserve'] = ' |
| 81 | 80 | UPDATE mw_mqueue_test SET cname = ?, rtime = ? WHERE id IN ( |