@@ -155,8 +155,7 @@ |
||
155 | 155 | $files[] = $entry->getPathname(); |
156 | 156 | } |
157 | 157 | } |
158 | - } |
|
159 | - else |
|
158 | + } else |
|
160 | 159 | { |
161 | 160 | $files[] = $location; |
162 | 161 | } |
@@ -75,7 +75,9 @@ discard block |
||
75 | 75 | } |
76 | 76 | } |
77 | 77 | } |
78 | - catch( \Exception $e ) {; } // no translation found |
|
78 | + catch( \Exception $e ) |
|
79 | + { |
|
80 | +; } // no translation found |
|
79 | 81 | |
80 | 82 | return (string) $string; |
81 | 83 | } |
@@ -104,7 +106,9 @@ discard block |
||
104 | 106 | } |
105 | 107 | } |
106 | 108 | } |
107 | - catch( \Exception $e ) {; } // no translation found |
|
109 | + catch( \Exception $e ) |
|
110 | + { |
|
111 | +; } // no translation found |
|
108 | 112 | |
109 | 113 | if( $index > 0 ) { |
110 | 114 | return (string) $plural; |
@@ -69,9 +69,12 @@ |
||
69 | 69 | */ |
70 | 70 | public function execute() : \Aimeos\MW\DB\Result\Iface |
71 | 71 | { |
72 | - try { |
|
72 | + try |
|
73 | + { |
|
73 | 74 | $result = $this->exec(); |
74 | - } catch( \PDOException $e ) { |
|
75 | + } |
|
76 | + catch( \PDOException $e ) |
|
77 | + { |
|
75 | 78 | throw new \Aimeos\MW\DB\Exception( $e->getMessage() . ': ' . $this->sql, $e->getCode() ); |
76 | 79 | } |
77 | 80 |
@@ -51,9 +51,12 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function affectedRows() : int |
53 | 53 | { |
54 | - try { |
|
54 | + try |
|
55 | + { |
|
55 | 56 | return $this->statement->rowCount(); |
56 | - } catch( \PDOException $e ) { |
|
57 | + } |
|
58 | + catch( \PDOException $e ) |
|
59 | + { |
|
57 | 60 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
58 | 61 | } |
59 | 62 | } |
@@ -68,9 +71,12 @@ discard block |
||
68 | 71 | */ |
69 | 72 | public function fetch( int $style = \Aimeos\MW\DB\Result\Base::FETCH_ASSOC ) : ?array |
70 | 73 | { |
71 | - try { |
|
74 | + try |
|
75 | + { |
|
72 | 76 | return $this->statement->fetch( $style ? \PDO::FETCH_ASSOC : \PDO::FETCH_NUM ) ?: null; |
73 | - } catch( \PDOException $e ) { |
|
77 | + } |
|
78 | + catch( \PDOException $e ) |
|
79 | + { |
|
74 | 80 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
75 | 81 | } |
76 | 82 | } |
@@ -84,9 +90,12 @@ discard block |
||
84 | 90 | */ |
85 | 91 | public function finish() : Iface |
86 | 92 | { |
87 | - try { |
|
93 | + try |
|
94 | + { |
|
88 | 95 | $this->statement->closeCursor(); |
89 | - } catch( \PDOException $e ) { |
|
96 | + } |
|
97 | + catch( \PDOException $e ) |
|
98 | + { |
|
90 | 99 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
91 | 100 | } |
92 | 101 | |
@@ -101,9 +110,12 @@ discard block |
||
101 | 110 | */ |
102 | 111 | public function nextResult() : bool |
103 | 112 | { |
104 | - try { |
|
113 | + try |
|
114 | + { |
|
105 | 115 | return $this->statement->nextRowset(); |
106 | - } catch( \PDOException $e ) { |
|
116 | + } |
|
117 | + catch( \PDOException $e ) |
|
118 | + { |
|
107 | 119 | return false; |
108 | 120 | } |
109 | 121 | } |
@@ -69,8 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | if( in_array( $op, $operators['combine'], true ) ) { |
71 | 71 | return $this->createCombineExpression( $op, (array) $value ); |
72 | - } |
|
73 | - else if( in_array( $op, $operators['compare'], true ) ) { |
|
72 | + } else if( in_array( $op, $operators['compare'], true ) ) { |
|
74 | 73 | return $this->createCompareExpression( $op, (array) $value ); |
75 | 74 | } |
76 | 75 | |
@@ -147,11 +146,9 @@ discard block |
||
147 | 146 | |
148 | 147 | if( in_array( $op, $operators['combine'], true ) ) { |
149 | 148 | $results[] = $this->createCombineExpression( $op, (array) $entry[$op] ); |
150 | - } |
|
151 | - else if( in_array( $op, $operators['compare'], true ) ) { |
|
149 | + } else if( in_array( $op, $operators['compare'], true ) ) { |
|
152 | 150 | $results[] = $this->createCompareExpression( $op, (array) $entry[$op] ); |
153 | - } |
|
154 | - else { |
|
151 | + } else { |
|
155 | 152 | throw new \Aimeos\MW\Common\Exception( sprintf( 'Invalid operator "%1$s"', $op ) ); |
156 | 153 | } |
157 | 154 | } |
@@ -74,8 +74,7 @@ |
||
74 | 74 | SELECT * FROM mw_mqueue_test WHERE queue = ? AND cname = ? AND rtime = ? |
75 | 75 | ORDER BY id LIMIT 1 |
76 | 76 | '; |
77 | - } |
|
78 | - else |
|
77 | + } else |
|
79 | 78 | { |
80 | 79 | $config['sql']['reserve'] = ' |
81 | 80 | UPDATE mw_mqueue_test SET cname = ?, rtime = ? WHERE id IN ( |
@@ -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 | } |
@@ -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 ); |