@@ -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 | } |
@@ -158,14 +159,12 @@ discard block |
||
158 | 159 | { |
159 | 160 | $dsn .= 'Database=' . $dbase; |
160 | 161 | $dsn .= isset( $host ) ? ';Server=' . $host . ( isset( $port ) ? ',' . $port : '' ) : ''; |
161 | - } |
|
162 | - elseif( $sock == null ) |
|
162 | + } elseif( $sock == null ) |
|
163 | 163 | { |
164 | 164 | $dsn .= 'dbname=' . $dbase; |
165 | 165 | $dsn .= isset( $host ) ? ';host=' . $host : ''; |
166 | 166 | $dsn .= isset( $port ) ? ';port=' . $port : ''; |
167 | - } |
|
168 | - else |
|
167 | + } else |
|
169 | 168 | { |
170 | 169 | $dsn .= 'dbname=' . $dbase . ';unix_socket=' . $sock; |
171 | 170 | } |
@@ -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() ); |
313 | 312 | $cols = $search->translate( $search->getSortations(), $translations ); |
@@ -81,8 +81,7 @@ |
||
81 | 81 | |
82 | 82 | return $params; |
83 | 83 | }; |
84 | - } |
|
85 | - else |
|
84 | + } else |
|
86 | 85 | { |
87 | 86 | $search = ':site AND mindte."langid" = $1 AND CHARINDEX( $2, content )'; |
88 | 87 | $sort = '-CHARINDEX( $2, content )'; |
@@ -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 | } |
@@ -156,9 +156,12 @@ discard block |
||
156 | 156 | */ |
157 | 157 | public function createItem( array $values = [] ) : \Aimeos\MShop\Common\Item\Iface |
158 | 158 | { |
159 | - try { |
|
159 | + try |
|
160 | + { |
|
160 | 161 | $values['log.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
161 | - } catch( \Exception $e ) { |
|
162 | + } |
|
163 | + catch( \Exception $e ) |
|
164 | + { |
|
162 | 165 | $values['log.siteid'] = null; |
163 | 166 | } |
164 | 167 | |
@@ -181,9 +184,12 @@ discard block |
||
181 | 184 | |
182 | 185 | $context = $this->getContext(); |
183 | 186 | |
184 | - try { |
|
187 | + try |
|
188 | + { |
|
185 | 189 | $siteid = $context->getLocale()->getSiteId(); |
186 | - } catch( \Exception $e ) { |
|
190 | + } |
|
191 | + catch( \Exception $e ) |
|
192 | + { |
|
187 | 193 | $siteid = ''; |
188 | 194 | } |
189 | 195 | |
@@ -235,8 +241,7 @@ discard block |
||
235 | 241 | */ |
236 | 242 | $path = 'madmin/log/manager/standard/insert'; |
237 | 243 | $sql = $this->addSqlColumns( array_keys( $columns ), $this->getSqlConfig( $path ) ); |
238 | - } |
|
239 | - else |
|
244 | + } else |
|
240 | 245 | { |
241 | 246 | /** madmin/log/manager/standard/update/mysql |
242 | 247 | * Updates an existing log record in the database |
@@ -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 { |
@@ -285,8 +285,7 @@ |
||
285 | 285 | |
286 | 286 | $params[] = $list; |
287 | 287 | } |
288 | - } |
|
289 | - else |
|
288 | + } else |
|
290 | 289 | { |
291 | 290 | $params[] = $this->escape( '==', $this->getParamType( $string ), $string ); |
292 | 291 | } |