@@ -32,9 +32,12 @@ discard block |
||
32 | 32 | { |
33 | 33 | parent::__construct( $config ); |
34 | 34 | |
35 | - try { |
|
35 | + try |
|
36 | + { |
|
36 | 37 | $this->conn = $this->createConnection(); |
37 | - } catch( \Aimeos\MW\DB\Exception $e ) { |
|
38 | + } |
|
39 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
40 | + { |
|
38 | 41 | throw new \Aimeos\MW\MQueue\Exception( $e->getMessage() ); |
39 | 42 | } |
40 | 43 | } |
@@ -111,14 +114,12 @@ discard block |
||
111 | 114 | { |
112 | 115 | $dsn .= 'Database=' . $dbase; |
113 | 116 | $dsn .= isset( $host ) ? ';Server=' . $host . ( isset( $port ) ? ',' . $port : '' ) : ''; |
114 | - } |
|
115 | - elseif( $sock == null ) |
|
117 | + } elseif( $sock == null ) |
|
116 | 118 | { |
117 | 119 | $dsn .= 'dbname=' . $dbase; |
118 | 120 | $dsn .= isset( $host ) ? ';host=' . $host : ''; |
119 | 121 | $dsn .= isset( $port ) ? ';port=' . $port : ''; |
120 | - } |
|
121 | - else |
|
122 | + } else |
|
122 | 123 | { |
123 | 124 | $dsn .= 'dbname=' . $dbase . ';unix_socket=' . $sock; |
124 | 125 | } |
@@ -38,8 +38,7 @@ |
||
38 | 38 | ) { |
39 | 39 | $this->execute( 'DROP TABLE "mshop_index_text"' ); |
40 | 40 | $this->status( 'done' ); |
41 | - } |
|
42 | - else |
|
41 | + } else |
|
43 | 42 | { |
44 | 43 | $this->status( 'OK' ); |
45 | 44 | } |
@@ -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( [] ); |
@@ -453,7 +453,7 @@ |
||
453 | 453 | $ext = isset( $list[$mimeext] ) ? '.' . $list[$mimeext] : ( ctype_alpha( $mimeext ) ? '.' . $mimeext : '' ); |
454 | 454 | $siteId = $this->context->getLocale()->getSiteId(); |
455 | 455 | |
456 | - return "${siteId}/${type}/${filename[0]}/${filename[1]}/${filename}${ext}"; |
|
456 | + return "${siteid}/${type}/${filename[0]}/${filename[1]}/${filename}${ext}"; |
|
457 | 457 | } |
458 | 458 | |
459 | 459 |