@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function bindParam($column, &$variable, $type = ParameterType::STRING, $length = null) |
115 | 115 | { |
116 | - $this->_bindParam[$column] =& $variable; |
|
116 | + $this->_bindParam[$column] = & $variable; |
|
117 | 117 | |
118 | 118 | if ($type && isset(self::$_typeMap[$type])) { |
119 | 119 | $type = self::$_typeMap[$type]; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $type = DB2_CHAR; |
122 | 122 | } |
123 | 123 | |
124 | - if (!db2_bind_param($this->_stmt, $column, "variable", DB2_PARAM_IN, $type)) { |
|
124 | + if ( ! db2_bind_param($this->_stmt, $column, "variable", DB2_PARAM_IN, $type)) { |
|
125 | 125 | throw new DB2Exception(db2_stmt_errormsg()); |
126 | 126 | } |
127 | 127 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | $this->_bindParam = []; |
141 | 141 | |
142 | - if (!db2_free_result($this->_stmt)) { |
|
142 | + if ( ! db2_free_result($this->_stmt)) { |
|
143 | 143 | return false; |
144 | 144 | } |
145 | 145 | |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | { |
237 | 237 | // do not try fetching from the statement if it's not expected to contain result |
238 | 238 | // in order to prevent exceptional situation |
239 | - if (!$this->result) { |
|
239 | + if ( ! $this->result) { |
|
240 | 240 | return false; |
241 | 241 | } |
242 | 242 | |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | */ |
327 | 327 | public function rowCount() |
328 | 328 | { |
329 | - return (@db2_num_rows($this->_stmt)) ? : 0; |
|
329 | + return (@db2_num_rows($this->_stmt)) ?: 0; |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | /** |
@@ -41,11 +41,11 @@ |
||
41 | 41 | if ($params['host'] !== 'localhost' && $params['host'] != '127.0.0.1') { |
42 | 42 | // if the host isn't localhost, use extended connection params |
43 | 43 | $params['dbname'] = 'DRIVER={IBM DB2 ODBC DRIVER}' . |
44 | - ';DATABASE=' . $params['dbname'] . |
|
45 | - ';HOSTNAME=' . $params['host'] . |
|
46 | - ';PROTOCOL=' . $params['protocol'] . |
|
47 | - ';UID=' . $username . |
|
48 | - ';PWD=' . $password .';'; |
|
44 | + ';DATABASE=' . $params['dbname'] . |
|
45 | + ';HOSTNAME=' . $params['host'] . |
|
46 | + ';PROTOCOL=' . $params['protocol'] . |
|
47 | + ';UID=' . $username . |
|
48 | + ';PWD=' . $password .';'; |
|
49 | 49 | if (isset($params['port'])) { |
50 | 50 | $params['dbname'] .= 'PORT=' . $params['port']; |
51 | 51 | } |
@@ -44,8 +44,8 @@ |
||
44 | 44 | ';DATABASE=' . $params['dbname'] . |
45 | 45 | ';HOSTNAME=' . $params['host'] . |
46 | 46 | ';PROTOCOL=' . $params['protocol'] . |
47 | - ';UID=' . $username . |
|
48 | - ';PWD=' . $password .';'; |
|
47 | + ';UID=' . $username . |
|
48 | + ';PWD=' . $password . ';'; |
|
49 | 49 | if (isset($params['port'])) { |
50 | 50 | $params['dbname'] .= 'PORT=' . $params['port']; |
51 | 51 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | private function convertParamType(int $type) : int |
214 | 214 | { |
215 | - if (! isset(self::PARAM_TYPE_MAP[$type])) { |
|
215 | + if ( ! isset(self::PARAM_TYPE_MAP[$type])) { |
|
216 | 216 | throw new \InvalidArgumentException('Invalid parameter type: ' . $type); |
217 | 217 | } |
218 | 218 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | return null; |
231 | 231 | } |
232 | 232 | |
233 | - if (! isset(self::FETCH_MODE_MAP[$fetchMode])) { |
|
233 | + if ( ! isset(self::FETCH_MODE_MAP[$fetchMode])) { |
|
234 | 234 | throw new \InvalidArgumentException('Invalid fetch mode: ' . $fetchMode); |
235 | 235 | } |
236 | 236 |
@@ -145,8 +145,8 @@ |
||
145 | 145 | } |
146 | 146 | |
147 | 147 | return '(DESCRIPTION=' . |
148 | - '(ADDRESS=(PROTOCOL=TCP)(HOST=' . $params['host'] . ')(PORT=' . $params['port'] . '))' . |
|
149 | - '(CONNECT_DATA=(' . $service . ')' . $instance . $pooled . '))'; |
|
148 | + '(ADDRESS=(PROTOCOL=TCP)(HOST=' . $params['host'] . ')(PORT=' . $params['port'] . '))' . |
|
149 | + '(CONNECT_DATA=(' . $service . ')' . $instance . $pooled . '))'; |
|
150 | 150 | |
151 | 151 | } |
152 | 152 |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function __construct($username, $password, $db, $charset = null, $sessionMode = OCI_DEFAULT, $persistent = false) |
74 | 74 | { |
75 | - if (!defined('OCI_NO_AUTO_COMMIT')) { |
|
75 | + if ( ! defined('OCI_NO_AUTO_COMMIT')) { |
|
76 | 76 | define('OCI_NO_AUTO_COMMIT', 0); |
77 | 77 | } |
78 | 78 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | */ |
206 | 206 | public function commit() |
207 | 207 | { |
208 | - if (!oci_commit($this->dbh)) { |
|
208 | + if ( ! oci_commit($this->dbh)) { |
|
209 | 209 | throw OCI8Exception::fromErrorInfo($this->errorInfo()); |
210 | 210 | } |
211 | 211 | $this->executeMode = OCI_COMMIT_ON_SUCCESS; |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | */ |
219 | 219 | public function rollBack() |
220 | 220 | { |
221 | - if (!oci_rollback($this->dbh)) { |
|
221 | + if ( ! oci_rollback($this->dbh)) { |
|
222 | 222 | throw OCI8Exception::fromErrorInfo($this->errorInfo()); |
223 | 223 | } |
224 | 224 | $this->executeMode = OCI_COMMIT_ON_SUCCESS; |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $currentLiteralDelimiter = null; |
163 | 163 | |
164 | 164 | do { |
165 | - if (!$currentLiteralDelimiter) { |
|
165 | + if ( ! $currentLiteralDelimiter) { |
|
166 | 166 | $result = self::findPlaceholderOrOpeningQuote( |
167 | 167 | $statement, |
168 | 168 | $tokenOffset, |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | ) { |
212 | 212 | $token = self::findToken($statement, $tokenOffset, '/[?\'"]/'); |
213 | 213 | |
214 | - if (!$token) { |
|
214 | + if ( ! $token) { |
|
215 | 215 | return false; |
216 | 216 | } |
217 | 217 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | '/' . preg_quote($currentLiteralDelimiter, '/') . '/' |
254 | 254 | ); |
255 | 255 | |
256 | - if (!$token) { |
|
256 | + if ( ! $token) { |
|
257 | 257 | return false; |
258 | 258 | } |
259 | 259 | |
@@ -301,16 +301,16 @@ discard block |
||
301 | 301 | $lob = oci_new_descriptor($this->_dbh, OCI_D_LOB); |
302 | 302 | $lob->writeTemporary($variable, OCI_TEMP_BLOB); |
303 | 303 | |
304 | - $this->boundValues[$column] =& $lob; |
|
304 | + $this->boundValues[$column] = & $lob; |
|
305 | 305 | |
306 | 306 | return oci_bind_by_name($this->_sth, $column, $lob, -1, OCI_B_BLOB); |
307 | 307 | } elseif ($length !== null) { |
308 | - $this->boundValues[$column] =& $variable; |
|
308 | + $this->boundValues[$column] = & $variable; |
|
309 | 309 | |
310 | 310 | return oci_bind_by_name($this->_sth, $column, $variable, $length); |
311 | 311 | } |
312 | 312 | |
313 | - $this->boundValues[$column] =& $variable; |
|
313 | + $this->boundValues[$column] = & $variable; |
|
314 | 314 | |
315 | 315 | return oci_bind_by_name($this->_sth, $column, $variable); |
316 | 316 | } |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | public function closeCursor() |
322 | 322 | { |
323 | 323 | // not having the result means there's nothing to close |
324 | - if (!$this->result) { |
|
324 | + if ( ! $this->result) { |
|
325 | 325 | return true; |
326 | 326 | } |
327 | 327 | |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | { |
413 | 413 | // do not try fetching from the statement if it's not expected to contain result |
414 | 414 | // in order to prevent exceptional situation |
415 | - if (!$this->result) { |
|
415 | + if ( ! $this->result) { |
|
416 | 416 | return false; |
417 | 417 | } |
418 | 418 | |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | return oci_fetch_object($this->_sth); |
427 | 427 | } |
428 | 428 | |
429 | - if (! isset(self::$fetchModeMap[$fetchMode])) { |
|
429 | + if ( ! isset(self::$fetchModeMap[$fetchMode])) { |
|
430 | 430 | throw new \InvalidArgumentException("Invalid fetch style: " . $fetchMode); |
431 | 431 | } |
432 | 432 | |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | |
471 | 471 | // do not try fetching from the statement if it's not expected to contain result |
472 | 472 | // in order to prevent exceptional situation |
473 | - if (!$this->result) { |
|
473 | + if ( ! $this->result) { |
|
474 | 474 | return []; |
475 | 475 | } |
476 | 476 | |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | { |
493 | 493 | // do not try fetching from the statement if it's not expected to contain result |
494 | 494 | // in order to prevent exceptional situation |
495 | - if (!$this->result) { |
|
495 | + if ( ! $this->result) { |
|
496 | 496 | return false; |
497 | 497 | } |
498 | 498 |
@@ -107,7 +107,7 @@ |
||
107 | 107 | $buildVersion = $versionParts['build'] ?? 0; |
108 | 108 | $version = $majorVersion . '.' . $minorVersion . '.' . $patchVersion . '.' . $buildVersion; |
109 | 109 | |
110 | - switch(true) { |
|
110 | + switch (true) { |
|
111 | 111 | case version_compare($version, '16', '>='): |
112 | 112 | return new SQLAnywhere16Platform(); |
113 | 113 | case version_compare($version, '12', '>='): |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $this->setSecureConnection($params); |
81 | 81 | $this->setDriverOptions($driverOptions); |
82 | 82 | |
83 | - set_error_handler(function () {}); |
|
83 | + set_error_handler(function() {}); |
|
84 | 84 | try { |
85 | 85 | if ( ! $this->_conn->real_connect($params['host'], $username, $password, $dbname, $port, $socket, $flags)) { |
86 | 86 | throw new MysqliException($this->_conn->connect_error, $this->_conn->sqlstate ?? 'HY000', $this->_conn->connect_errno); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | */ |
162 | 162 | public function quote($input, $type = ParameterType::STRING) |
163 | 163 | { |
164 | - return "'". $this->_conn->escape_string($input) ."'"; |
|
164 | + return "'" . $this->_conn->escape_string($input) . "'"; |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | continue; |
257 | 257 | } |
258 | 258 | |
259 | - if (!in_array($option, $supportedDriverOptions, true)) { |
|
259 | + if ( ! in_array($option, $supportedDriverOptions, true)) { |
|
260 | 260 | throw new MysqliException( |
261 | 261 | sprintf($exceptionMsg, 'Unsupported', $option, $value) |
262 | 262 | ); |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | */ |
296 | 296 | private function setSecureConnection(array $params) |
297 | 297 | { |
298 | - if (! isset($params['ssl_key']) && |
|
298 | + if ( ! isset($params['ssl_key']) && |
|
299 | 299 | ! isset($params['ssl_cert']) && |
300 | 300 | ! isset($params['ssl_ca']) && |
301 | 301 | ! isset($params['ssl_capath']) && |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | } |
133 | 133 | } |
134 | 134 | |
135 | - $this->_bindedValues[$column] =& $variable; |
|
135 | + $this->_bindedValues[$column] = & $variable; |
|
136 | 136 | $this->types[$column - 1] = $type; |
137 | 137 | |
138 | 138 | return true; |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | } |
155 | 155 | |
156 | 156 | $this->_values[$param] = $value; |
157 | - $this->_bindedValues[$param] =& $this->_values[$param]; |
|
157 | + $this->_bindedValues[$param] = & $this->_values[$param]; |
|
158 | 158 | $this->types[$param - 1] = $type; |
159 | 159 | |
160 | 160 | return true; |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | throw new MysqliException($this->_stmt->error, $this->_stmt->errno); |
172 | 172 | } |
173 | 173 | } else { |
174 | - if (!call_user_func_array([$this->_stmt, 'bind_param'], [$this->types] + $this->_bindedValues)) { |
|
174 | + if ( ! call_user_func_array([$this->_stmt, 'bind_param'], [$this->types] + $this->_bindedValues)) { |
|
175 | 175 | throw new MysqliException($this->_stmt->error, $this->_stmt->sqlstate, $this->_stmt->errno); |
176 | 176 | } |
177 | 177 | } |
@@ -217,10 +217,10 @@ discard block |
||
217 | 217 | |
218 | 218 | $refs = []; |
219 | 219 | foreach ($this->_rowBindedValues as $key => &$value) { |
220 | - $refs[$key] =& $value; |
|
220 | + $refs[$key] = & $value; |
|
221 | 221 | } |
222 | 222 | |
223 | - if (!call_user_func_array([$this->_stmt, 'bind_result'], $refs)) { |
|
223 | + if ( ! call_user_func_array([$this->_stmt, 'bind_result'], $refs)) { |
|
224 | 224 | throw new MysqliException($this->_stmt->error, $this->_stmt->sqlstate, $this->_stmt->errno); |
225 | 225 | } |
226 | 226 | } |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | $params[0] = $types; |
245 | 245 | |
246 | 246 | foreach ($values as &$v) { |
247 | - $params[] =& $v; |
|
247 | + $params[] = & $v; |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | return call_user_func_array([$this->_stmt, 'bind_param'], $params); |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | { |
277 | 277 | // do not try fetching from the statement if it's not expected to contain result |
278 | 278 | // in order to prevent exceptional situation |
279 | - if (!$this->result) { |
|
279 | + if ( ! $this->result) { |
|
280 | 280 | return false; |
281 | 281 | } |
282 | 282 |