@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace voku\db\exceptions; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace voku\db; |
| 6 | 6 | |
@@ -23,6 +23,6 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function __toString() |
| 25 | 25 | { |
| 26 | - return $this->source . ' ' . $this->operator . ' ' . $this->target; |
|
| 26 | + return $this->source.' '.$this->operator.' '.$this->target; |
|
| 27 | 27 | } |
| 28 | 28 | } |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace voku\db\exceptions; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace voku\db\exceptions; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace voku\db\exceptions; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace voku\db\exceptions; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace voku\db; |
| 6 | 6 | |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | { |
| 680 | 680 | if ($as_array) { |
| 681 | 681 | return \array_map( |
| 682 | - function ($object) { |
|
| 682 | + function($object) { |
|
| 683 | 683 | return (array)$object; |
| 684 | 684 | }, |
| 685 | 685 | \mysqli_fetch_fields($this->_result) |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | } |
| 792 | 792 | |
| 793 | 793 | return \array_map( |
| 794 | - function ($values) use ($keys) { |
|
| 794 | + function($values) use ($keys) { |
|
| 795 | 795 | return \array_combine($keys, $values); |
| 796 | 796 | }, $rows |
| 797 | 797 | ); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace voku\db; |
| 6 | 6 | |
@@ -139,9 +139,9 @@ discard block |
||
| 139 | 139 | $this->logger( |
| 140 | 140 | [ |
| 141 | 141 | 'error', |
| 142 | - '<strong>' . \date( |
|
| 142 | + '<strong>'.\date( |
|
| 143 | 143 | 'd. m. Y G:i:s' |
| 144 | - ) . ' (' . $fileInfo['file'] . ' line: ' . $fileInfo['line'] . ') (sql-error):</strong> ' . $error . '<br>', |
|
| 144 | + ).' ('.$fileInfo['file'].' line: '.$fileInfo['line'].') (sql-error):</strong> '.$error.'<br>', |
|
| 145 | 145 | ] |
| 146 | 146 | ); |
| 147 | 147 | |
@@ -153,11 +153,11 @@ discard block |
||
| 153 | 153 | $box_bg = $this->css_mysql_box_bg; |
| 154 | 154 | |
| 155 | 155 | echo ' |
| 156 | - <div class="OBJ-mysql-box" style="border:' . $box_border . '; background:' . $box_bg . '; padding:10px; margin:10px;"> |
|
| 156 | + <div class="OBJ-mysql-box" style="border:' . $box_border.'; background:'.$box_bg.'; padding:10px; margin:10px;"> |
|
| 157 | 157 | <b style="font-size:14px;">MYSQL Error:</b> |
| 158 | 158 | <code style="display:block;"> |
| 159 | - file / line: ' . $fileInfo['file'] . ' / ' . $fileInfo['line'] . ' |
|
| 160 | - ' . $error . ' |
|
| 159 | + file / line: ' . $fileInfo['file'].' / '.$fileInfo['line'].' |
|
| 160 | + ' . $error.' |
|
| 161 | 161 | </code> |
| 162 | 162 | </div> |
| 163 | 163 | '; |
@@ -295,21 +295,21 @@ discard block |
||
| 295 | 295 | // get extra info |
| 296 | 296 | $infoExtra = \mysqli_info($this->_db->getLink()); |
| 297 | 297 | if ($infoExtra) { |
| 298 | - $infoExtra = ' | info => ' . $infoExtra; |
|
| 298 | + $infoExtra = ' | info => '.$infoExtra; |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | // |
| 302 | 302 | // logging |
| 303 | 303 | // |
| 304 | 304 | |
| 305 | - $info = 'time => ' . \round($duration, 5) . ' | results => ' . (int)$results . $infoExtra . ' | SQL => ' . UTF8::htmlentities($sql); |
|
| 305 | + $info = 'time => '.\round($duration, 5).' | results => '.(int)$results.$infoExtra.' | SQL => '.UTF8::htmlentities($sql); |
|
| 306 | 306 | |
| 307 | 307 | $fileInfo = $this->getFileAndLineFromSql(); |
| 308 | 308 | |
| 309 | 309 | return $this->logger( |
| 310 | 310 | [ |
| 311 | 311 | $logLevel, |
| 312 | - '<strong>' . \date('d. m. Y G:i:s') . ' (' . $fileInfo['file'] . ' line: ' . $fileInfo['line'] . '):</strong> ' . $info . '<br>', |
|
| 312 | + '<strong>'.\date('d. m. Y G:i:s').' ('.$fileInfo['file'].' line: '.$fileInfo['line'].'):</strong> '.$info.'<br>', |
|
| 313 | 313 | 'sql', |
| 314 | 314 | ] |
| 315 | 315 | ); |
@@ -375,21 +375,21 @@ discard block |
||
| 375 | 375 | $this->logger( |
| 376 | 376 | [ |
| 377 | 377 | 'debug', |
| 378 | - $subject . ' | ' . $htmlBody, |
|
| 378 | + $subject.' | '.$htmlBody, |
|
| 379 | 379 | ] |
| 380 | 380 | ); |
| 381 | 381 | } elseif ($priority > 3) { |
| 382 | 382 | $this->logger( |
| 383 | 383 | [ |
| 384 | 384 | 'error', |
| 385 | - $subject . ' | ' . $htmlBody, |
|
| 385 | + $subject.' | '.$htmlBody, |
|
| 386 | 386 | ] |
| 387 | 387 | ); |
| 388 | 388 | } elseif ($priority < 3) { |
| 389 | 389 | $this->logger( |
| 390 | 390 | [ |
| 391 | 391 | 'info', |
| 392 | - $subject . ' | ' . $htmlBody, |
|
| 392 | + $subject.' | '.$htmlBody, |
|
| 393 | 393 | ] |
| 394 | 394 | ); |
| 395 | 395 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace voku\db; |
| 6 | 6 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | foreach ($this->_boundParams as $param) { |
| 84 | 84 | $arguments[0] .= $param['type']; |
| 85 | - $arguments[] =& $param['value']; |
|
| 85 | + $arguments[] = & $param['value']; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | return $arguments; |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $value = $this->_db->escape($value); |
| 106 | 106 | |
| 107 | 107 | if ($type === 's') { |
| 108 | - $valueForSqlWithBoundParameters = "'" . $value . "'"; |
|
| 108 | + $valueForSqlWithBoundParameters = "'".$value."'"; |
|
| 109 | 109 | } elseif ($type === 'i') { |
| 110 | 110 | $valueForSqlWithBoundParameters = (int)$value; |
| 111 | 111 | } elseif ($type === 'd') { |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | // debug_backtrace returns arguments by reference, see comments at http://php.net/manual/de/function.func-get-args.php |
| 183 | 183 | $trace = \debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 1); |
| 184 | 184 | |
| 185 | - $args =& $trace[0]['args']; |
|
| 185 | + $args = & $trace[0]['args']; |
|
| 186 | 186 | $types = \str_split($types); |
| 187 | 187 | |
| 188 | 188 | $args_count = \count($args) - 1; |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | $arg = 1; |
| 198 | 198 | foreach ($types as $typeInner) { |
| 199 | - $val =& $args[$arg]; |
|
| 199 | + $val = & $args[$arg]; |
|
| 200 | 200 | $this->_boundParams[] = [ |
| 201 | 201 | 'type' => $typeInner, |
| 202 | 202 | 'value' => &$val, |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | $bool = parent::prepare($query); |
| 333 | 333 | |
| 334 | 334 | if ($bool === false) { |
| 335 | - $this->_debug->displayError('Can not prepare query: ' . $query . ' | ' . $this->error, false); |
|
| 335 | + $this->_debug->displayError('Can not prepare query: '.$query.' | '.$this->error, false); |
|
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | return $bool; |
@@ -420,11 +420,11 @@ discard block |
||
| 420 | 420 | |
| 421 | 421 | // exit if we have more then 3 "DB server has gone away"-errors |
| 422 | 422 | if ($RECONNECT_COUNTER > 3) { |
| 423 | - $this->_debug->mailToAdmin('DB-Fatal-Error', $errorMsg . ":\n<br />" . $sql, 5); |
|
| 423 | + $this->_debug->mailToAdmin('DB-Fatal-Error', $errorMsg.":\n<br />".$sql, 5); |
|
| 424 | 424 | throw new DBGoneAwayException($errorMsg); |
| 425 | 425 | } |
| 426 | 426 | |
| 427 | - $this->_debug->mailToAdmin('DB-Error', $errorMsg . ":\n<br />" . $sql); |
|
| 427 | + $this->_debug->mailToAdmin('DB-Error', $errorMsg.":\n<br />".$sql); |
|
| 428 | 428 | |
| 429 | 429 | // reconnect |
| 430 | 430 | $RECONNECT_COUNTER++; |
@@ -434,10 +434,10 @@ discard block |
||
| 434 | 434 | return $this->execute(); |
| 435 | 435 | } |
| 436 | 436 | |
| 437 | - $this->_debug->mailToAdmin('SQL-Error', $errorMsg . ":\n<br />" . $sql); |
|
| 437 | + $this->_debug->mailToAdmin('SQL-Error', $errorMsg.":\n<br />".$sql); |
|
| 438 | 438 | |
| 439 | 439 | // this query returned an error, we must display it (only for dev) !!! |
| 440 | - $this->_debug->displayError($errorMsg . ' | ' . $sql); |
|
| 440 | + $this->_debug->displayError($errorMsg.' | '.$sql); |
|
| 441 | 441 | |
| 442 | 442 | return false; |
| 443 | 443 | } |