@@ -241,9 +241,12 @@ |
||
| 241 | 241 | { |
| 242 | 242 | if( self::$node === null ) |
| 243 | 243 | { |
| 244 | - try { |
|
| 244 | + try |
|
| 245 | + { |
|
| 245 | 246 | self::$node = random_bytes( 6 ); |
| 246 | - } catch( \Throwable $t ) { |
|
| 247 | + } |
|
| 248 | + catch( \Throwable $t ) |
|
| 249 | + { |
|
| 247 | 250 | if( function_exists( 'openssl_random_pseudo_bytes' ) ) { |
| 248 | 251 | self::$node = openssl_random_pseudo_bytes( 6 ); |
| 249 | 252 | } else { |
@@ -108,9 +108,12 @@ |
||
| 108 | 108 | */ |
| 109 | 109 | public function scan( string $path = null ) : iterable |
| 110 | 110 | { |
| 111 | - try { |
|
| 111 | + try |
|
| 112 | + { |
|
| 112 | 113 | return new \DirectoryIterator( $this->resolve( (string) $path ) ); |
| 113 | - } catch( \Exception $e ) { |
|
| 114 | + } |
|
| 115 | + catch( \Exception $e ) |
|
| 116 | + { |
|
| 114 | 117 | throw new Exception( $e->getMessage(), 0, $e ); |
| 115 | 118 | } |
| 116 | 119 | } |
@@ -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\Base\DB\Exception $e ) { |
|
| 38 | + } |
|
| 39 | + catch( \Aimeos\Base\DB\Exception $e ) |
|
| 40 | + { |
|
| 38 | 41 | throw new \Aimeos\Base\MQueue\Exception( $e->getMessage() ); |
| 39 | 42 | } |
| 40 | 43 | } |
@@ -110,14 +113,12 @@ discard block |
||
| 110 | 113 | { |
| 111 | 114 | $dsn .= 'Database=' . $dbase; |
| 112 | 115 | $dsn .= isset( $host ) ? ';Server=' . $host . ( isset( $port ) ? ',' . $port : '' ) : ''; |
| 113 | - } |
|
| 114 | - elseif( $sock == null ) |
|
| 116 | + } elseif( $sock == null ) |
|
| 115 | 117 | { |
| 116 | 118 | $dsn .= 'dbname=' . $dbase; |
| 117 | 119 | $dsn .= isset( $host ) ? ';host=' . $host : ''; |
| 118 | 120 | $dsn .= isset( $port ) ? ';port=' . $port : ''; |
| 119 | - } |
|
| 120 | - else |
|
| 121 | + } else |
|
| 121 | 122 | { |
| 122 | 123 | $dsn .= 'dbname=' . $dbase . ';unix_socket=' . $sock; |
| 123 | 124 | } |
@@ -139,8 +139,7 @@ |
||
| 139 | 139 | $list[] = $this->escape( '==', $this->getParamType( $item ), $item ); |
| 140 | 140 | } |
| 141 | 141 | $params[$i] = join( ',', $list ); |
| 142 | - } |
|
| 143 | - else |
|
| 142 | + } else |
|
| 144 | 143 | { |
| 145 | 144 | $params[$i] = $this->escape( '==', $this->getParamType( $params[$i] ), $params[$i] ); |
| 146 | 145 | } |
@@ -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 | } |