@@ -252,8 +252,7 @@ discard block |
||
| 252 | 252 | |
| 253 | 253 | if( in_array( $op, $operators['combine'], true ) ) { |
| 254 | 254 | return $this->createCombineExpression( $op, (array) $value ); |
| 255 | - } |
|
| 256 | - else if( in_array( $op, $operators['compare'], true ) ) { |
|
| 255 | + } else if( in_array( $op, $operators['compare'], true ) ) { |
|
| 257 | 256 | return $this->createCompareExpression( $op, (array) $value ); |
| 258 | 257 | } |
| 259 | 258 | |
@@ -307,11 +306,9 @@ discard block |
||
| 307 | 306 | |
| 308 | 307 | if( in_array( $op, $operators['combine'], true ) ) { |
| 309 | 308 | $results[] = $this->createCombineExpression( $op, (array) $entry[$op] ); |
| 310 | - } |
|
| 311 | - else if( in_array( $op, $operators['compare'], true ) ) { |
|
| 309 | + } else if( in_array( $op, $operators['compare'], true ) ) { |
|
| 312 | 310 | $results[] = $this->createCompareExpression( $op, (array) $entry[$op] ); |
| 313 | - } |
|
| 314 | - else { |
|
| 311 | + } else { |
|
| 315 | 312 | throw new \Aimeos\Base\Exception( sprintf( 'Invalid operator "%1$s"', $op ) ); |
| 316 | 313 | } |
| 317 | 314 | } |
@@ -60,9 +60,12 @@ |
||
| 60 | 60 | */ |
| 61 | 61 | public function affectedRows() : int |
| 62 | 62 | { |
| 63 | - try { |
|
| 63 | + try |
|
| 64 | + { |
|
| 64 | 65 | return $this->result->rowCount(); |
| 65 | - } catch( \Doctrine\DBAL\Driver\Exception $e ) { |
|
| 66 | + } |
|
| 67 | + catch( \Doctrine\DBAL\Driver\Exception $e ) |
|
| 68 | + { |
|
| 66 | 69 | throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode() ); |
| 67 | 70 | } |
| 68 | 71 | } |
@@ -213,14 +213,12 @@ |
||
| 213 | 213 | { |
| 214 | 214 | $dsn .= 'Database=' . $dbase; |
| 215 | 215 | $dsn .= isset( $host ) ? ';Server=' . $host . ( isset( $port ) ? ',' . $port : '' ) : ''; |
| 216 | - } |
|
| 217 | - elseif( $sock == null ) |
|
| 216 | + } elseif( $sock == null ) |
|
| 218 | 217 | { |
| 219 | 218 | $dsn .= 'dbname=' . $dbase; |
| 220 | 219 | $dsn .= isset( $host ) ? ';host=' . $host : ''; |
| 221 | 220 | $dsn .= isset( $port ) ? ';port=' . $port : ''; |
| 222 | - } |
|
| 223 | - else |
|
| 221 | + } else |
|
| 224 | 222 | { |
| 225 | 223 | $dsn .= 'dbname=' . $dbase . ';unix_socket=' . $sock; |
| 226 | 224 | } |
@@ -32,9 +32,12 @@ |
||
| 32 | 32 | { |
| 33 | 33 | parent::__construct( $config ); |
| 34 | 34 | |
| 35 | - try { |
|
| 35 | + try |
|
| 36 | + { |
|
| 36 | 37 | $this->conn = new \Aimeos\Base\DB\Connection\PDO( $config['db'] ?? [] ); |
| 37 | - } catch( \Aimeos\Base\DB\Exception $e ) { |
|
| 38 | + } |
|
| 39 | + catch( \Aimeos\Base\DB\Exception $e ) |
|
| 40 | + { |
|
| 38 | 41 | throw new \Aimeos\Base\MQueue\Exception( $e->getMessage(), -1, $e ); |
| 39 | 42 | } |
| 40 | 43 | } |
@@ -89,9 +89,12 @@ |
||
| 89 | 89 | */ |
| 90 | 90 | public function clear() : bool |
| 91 | 91 | { |
| 92 | - try { |
|
| 92 | + try |
|
| 93 | + { |
|
| 93 | 94 | $this->conn->create( $this->sql( 'clear' ) )->execute()->finish(); |
| 94 | - } catch( \Exception $e ) { |
|
| 95 | + } |
|
| 96 | + catch( \Exception $e ) |
|
| 97 | + { |
|
| 95 | 98 | return false; |
| 96 | 99 | } |
| 97 | 100 | |