@@ -214,9 +214,12 @@ |
||
214 | 214 | { |
215 | 215 | if( self::$node === null ) |
216 | 216 | { |
217 | - try { |
|
217 | + try |
|
218 | + { |
|
218 | 219 | self::$node = random_bytes( 6 ); |
219 | - } catch( \Throwable $t ) { |
|
220 | + } |
|
221 | + catch( \Throwable $t ) |
|
222 | + { |
|
220 | 223 | if( function_exists( 'openssl_random_pseudo_bytes' ) ) { |
221 | 224 | self::$node = openssl_random_pseudo_bytes( 6 ); |
222 | 225 | } else { |
@@ -60,8 +60,7 @@ |
||
60 | 60 | $sort = 'mindte_ft.RANK'; |
61 | 61 | |
62 | 62 | $func = $this->getFunctionRelevance(); |
63 | - } |
|
64 | - else |
|
63 | + } else |
|
65 | 64 | { |
66 | 65 | $search = ':site AND mindte."langid" = $1 AND CHARINDEX( $2, content )'; |
67 | 66 | $sort = '-CHARINDEX( $2, content )'; |
@@ -306,8 +306,7 @@ |
||
306 | 306 | if( empty( $search->getSortations() ) && ( $attribute = reset( $attributes ) ) !== false ) |
307 | 307 | { |
308 | 308 | $search = ( clone $search )->setSortations( [$search->sort( '+', $attribute->getCode() )] ); |
309 | - } |
|
310 | - elseif( !empty( $search->getSortations() ) ) |
|
309 | + } elseif( !empty( $search->getSortations() ) ) |
|
311 | 310 | { |
312 | 311 | $names = $search->translate( $search->getSortations(), [], $funcs ); |
313 | 312 | $cols = $search->translate( $search->getSortations(), $translations, $funcs ); |
@@ -117,8 +117,7 @@ |
||
117 | 117 | return false; |
118 | 118 | } |
119 | 119 | } |
120 | - } |
|
121 | - elseif( ( $addresses = $basket->getAddress( Address\Base::TYPE_PAYMENT ) ) !== [] ) |
|
120 | + } elseif( ( $addresses = $basket->getAddress( Address\Base::TYPE_PAYMENT ) ) !== [] ) |
|
122 | 121 | { |
123 | 122 | // use billing address if no delivery address is available |
124 | 123 | foreach( $addresses as $address ) |
@@ -305,8 +305,7 @@ discard block |
||
305 | 305 | foreach( $columns as $name ) { |
306 | 306 | $names .= '"' . $name . '", '; $values .= '?, '; |
307 | 307 | } |
308 | - } |
|
309 | - else |
|
308 | + } else |
|
310 | 309 | { |
311 | 310 | foreach( $columns as $name ) { |
312 | 311 | $names .= '"' . $name . '" = ?, '; |
@@ -691,11 +690,9 @@ discard block |
||
691 | 690 | |
692 | 691 | if( isset( $attributes[$prefix] ) && $attributes[$prefix] instanceof $iface ) { |
693 | 692 | return $attributes[$prefix]->getInternalDeps(); |
694 | - } |
|
695 | - elseif( isset( $attributes[$name] ) && $attributes[$name] instanceof $iface ) { |
|
693 | + } elseif( isset( $attributes[$name] ) && $attributes[$name] instanceof $iface ) { |
|
696 | 694 | return $attributes[$name]->getInternalDeps(); |
697 | - } |
|
698 | - else if( isset( $attributes['id'] ) && $attributes['id'] instanceof $iface ) { |
|
695 | + } else if( isset( $attributes['id'] ) && $attributes['id'] instanceof $iface ) { |
|
699 | 696 | return $attributes['id']->getInternalDeps(); |
700 | 697 | } |
701 | 698 |
@@ -110,7 +110,8 @@ discard block |
||
110 | 110 | |
111 | 111 | return array_pop( $this->connections[$name] ); |
112 | 112 | } |
113 | - catch( \PDOException $e ) { |
|
113 | + catch( \PDOException $e ) |
|
114 | + { |
|
114 | 115 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
115 | 116 | } |
116 | 117 | } |
@@ -160,14 +161,12 @@ discard block |
||
160 | 161 | { |
161 | 162 | $dsn .= 'Database=' . $dbase; |
162 | 163 | $dsn .= isset( $host ) ? ';Server=' . $host . ( isset( $port ) ? ',' . $port : '' ) : ''; |
163 | - } |
|
164 | - elseif( $sock == null ) |
|
164 | + } elseif( $sock == null ) |
|
165 | 165 | { |
166 | 166 | $dsn .= 'dbname=' . $dbase; |
167 | 167 | $dsn .= isset( $host ) ? ';host=' . $host : ''; |
168 | 168 | $dsn .= isset( $port ) ? ';port=' . $port : ''; |
169 | - } |
|
170 | - else |
|
169 | + } else |
|
171 | 170 | { |
172 | 171 | $dsn .= 'dbname=' . $dbase . ';unix_socket=' . $sock; |
173 | 172 | } |
@@ -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': |