@@ -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 | } |
@@ -331,7 +331,7 @@ |
||
| 331 | 331 | $fs->rm( $preview ); |
| 332 | 332 | } |
| 333 | 333 | } |
| 334 | - catch( \Exception $e ) { ; } // continue if removing file fails |
|
| 334 | + catch( \Exception $e ) {; } // continue if removing file fails |
|
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | return $item->setPreviews( [] ); |
@@ -107,7 +107,9 @@ discard block |
||
| 107 | 107 | $fs->copy( $preview, $newPath ); |
| 108 | 108 | $previews[$size] = $newPath; |
| 109 | 109 | } |
| 110 | - catch( \Aimeos\MW\Filesystem\Exception $e ) {} // mime icons can't be copied |
|
| 110 | + catch( \Aimeos\MW\Filesystem\Exception $e ) |
|
| 111 | + { |
|
| 112 | +} // mime icons can't be copied |
|
| 111 | 113 | } |
| 112 | 114 | } |
| 113 | 115 | |
@@ -369,7 +371,9 @@ discard block |
||
| 369 | 371 | $fs->rm( $preview ); |
| 370 | 372 | } |
| 371 | 373 | } |
| 372 | - catch( \Exception $e ) { ; } // continue if removing file fails |
|
| 374 | + catch( \Exception $e ) |
|
| 375 | + { |
|
| 376 | +; } // continue if removing file fails |
|
| 373 | 377 | } |
| 374 | 378 | |
| 375 | 379 | return $item->setPreviews( [] ); |
@@ -454,7 +454,7 @@ |
||
| 454 | 454 | $siteId = $this->context->getLocale()->getSiteId(); |
| 455 | 455 | |
| 456 | 456 | // the "d" after {siteid} is the required extension for Windows (no dots at the and allowed) |
| 457 | - return "${siteId}d/${type}/${filename[0]}/${filename[1]}/${filename}${ext}"; |
|
| 457 | + return "${siteid}d/${type}/${filename[0]}/${filename[1]}/${filename}${ext}"; |
|
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | |
@@ -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() ); |
@@ -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 | } |