@@ -1098,7 +1098,7 @@ |
||
| 1098 | 1098 | * @param string $query <p>sql-query</p> |
| 1099 | 1099 | * @param bool $useCache optional <p>use cache?</p> |
| 1100 | 1100 | * @param int $cacheTTL optional <p>cache-ttl in seconds</p> |
| 1101 | - * @param DB|null $db optional <p>the database connection</p> |
|
| 1101 | + * @param null|\self $db optional <p>the database connection</p> |
|
| 1102 | 1102 | * |
| 1103 | 1103 | *@throws QueryException |
| 1104 | 1104 | * |
@@ -299,10 +299,10 @@ discard block |
||
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | if ($port) { |
| 302 | - $this->port = (int) $port; |
|
| 302 | + $this->port = (int)$port; |
|
| 303 | 303 | } else { |
| 304 | 304 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
| 305 | - $this->port = (int) @\ini_get('mysqli.default_port'); |
|
| 305 | + $this->port = (int)@\ini_get('mysqli.default_port'); |
|
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | // fallback |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | foreach ($arrayPair as $_key => $_value) { |
| 350 | 350 | $_connector = '='; |
| 351 | 351 | $_glueHelper = ''; |
| 352 | - $_key_upper = \strtoupper((string) $_key); |
|
| 352 | + $_key_upper = \strtoupper((string)$_key); |
|
| 353 | 353 | |
| 354 | 354 | if (\strpos($_key_upper, ' NOT') !== false) { |
| 355 | 355 | $_connector = 'NOT'; |
@@ -431,18 +431,18 @@ discard block |
||
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | if ($_connector === 'NOT IN' || $_connector === 'IN') { |
| 434 | - $_value = '(' . \implode(',', $_value) . ')'; |
|
| 434 | + $_value = '('.\implode(',', $_value).')'; |
|
| 435 | 435 | } elseif ($_connector === 'NOT BETWEEN' || $_connector === 'BETWEEN') { |
| 436 | - $_value = '(' . \implode(' AND ', $_value) . ')'; |
|
| 436 | + $_value = '('.\implode(' AND ', $_value).')'; |
|
| 437 | 437 | } elseif ($firstKey && $firstValue) { |
| 438 | - if (\strpos((string) $firstKey, ' +') !== false) { |
|
| 439 | - $firstKey = \str_replace(' +', '', (string) $firstKey); |
|
| 440 | - $_value = $firstKey . ' + ' . $firstValue; |
|
| 438 | + if (\strpos((string)$firstKey, ' +') !== false) { |
|
| 439 | + $firstKey = \str_replace(' +', '', (string)$firstKey); |
|
| 440 | + $_value = $firstKey.' + '.$firstValue; |
|
| 441 | 441 | } |
| 442 | 442 | |
| 443 | - if (\strpos((string) $firstKey, ' -') !== false) { |
|
| 444 | - $firstKey = \str_replace(' -', '', (string) $firstKey); |
|
| 445 | - $_value = $firstKey . ' - ' . $firstValue; |
|
| 443 | + if (\strpos((string)$firstKey, ' -') !== false) { |
|
| 444 | + $firstKey = \str_replace(' -', '', (string)$firstKey); |
|
| 445 | + $_value = $firstKey.' - '.$firstValue; |
|
| 446 | 446 | } |
| 447 | 447 | } |
| 448 | 448 | } else { |
@@ -451,18 +451,18 @@ discard block |
||
| 451 | 451 | |
| 452 | 452 | $quoteString = $this->quote_string( |
| 453 | 453 | \trim( |
| 454 | - (string) \str_ireplace( |
|
| 454 | + (string)\str_ireplace( |
|
| 455 | 455 | [ |
| 456 | 456 | $_connector, |
| 457 | 457 | $_glueHelper, |
| 458 | 458 | ], |
| 459 | 459 | '', |
| 460 | - (string) $_key |
|
| 460 | + (string)$_key |
|
| 461 | 461 | ) |
| 462 | 462 | ) |
| 463 | 463 | ); |
| 464 | 464 | |
| 465 | - $_value = (array) $_value; |
|
| 465 | + $_value = (array)$_value; |
|
| 466 | 466 | |
| 467 | 467 | if (!$_glueHelper) { |
| 468 | 468 | $_glueHelper = $glue; |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | $valueInner = "''"; |
| 487 | 487 | } |
| 488 | 488 | |
| 489 | - $sql .= ' ' . $_glueHelperInner . ' ' . $quoteString . ' ' . $_connector . ' ' . $valueInner . " \n"; |
|
| 489 | + $sql .= ' '.$_glueHelperInner.' '.$quoteString.' '.$_connector.' '.$valueInner." \n"; |
|
| 490 | 490 | $tmpCounter++; |
| 491 | 491 | } |
| 492 | 492 | |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | unset($params[$key]); |
| 539 | 539 | |
| 540 | 540 | $sql = \substr_replace($sql, $replacement, $offset, 1); |
| 541 | - $offset = \strpos($sql, '?', $offset + \strlen((string) $replacement)); |
|
| 541 | + $offset = \strpos($sql, '?', $offset + \strlen((string)$replacement)); |
|
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | return ['sql' => $sql, 'params' => $params]; |
@@ -575,7 +575,7 @@ discard block |
||
| 575 | 575 | |
| 576 | 576 | // add ":" if needed |
| 577 | 577 | if (\strpos($name, ':') !== 0) { |
| 578 | - $nameTmp = ':' . $name; |
|
| 578 | + $nameTmp = ':'.$name; |
|
| 579 | 579 | } else { |
| 580 | 580 | $nameTmp = $name; |
| 581 | 581 | } |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | if ($offset === null) { |
| 584 | 584 | $offset = \strpos($sql, $nameTmp); |
| 585 | 585 | } else { |
| 586 | - $offset = \strpos($sql, $nameTmp, $offset + \strlen((string) $replacement)); |
|
| 586 | + $offset = \strpos($sql, $nameTmp, $offset + \strlen((string)$replacement)); |
|
| 587 | 587 | } |
| 588 | 588 | |
| 589 | 589 | if ($offset === false) { |
@@ -615,7 +615,7 @@ discard block |
||
| 615 | 615 | return \mysqli_affected_rows($this->mysqli_link); |
| 616 | 616 | } |
| 617 | 617 | |
| 618 | - return (int) $this->affected_rows; |
|
| 618 | + return (int)$this->affected_rows; |
|
| 619 | 619 | } |
| 620 | 620 | |
| 621 | 621 | /** |
@@ -773,7 +773,7 @@ discard block |
||
| 773 | 773 | $this->connected = $this->doctrine_connection->isConnected(); |
| 774 | 774 | |
| 775 | 775 | if (!$this->connected) { |
| 776 | - $error = 'Error connecting to mysql server: ' . \print_r($this->doctrine_connection->errorInfo(), false); |
|
| 776 | + $error = 'Error connecting to mysql server: '.\print_r($this->doctrine_connection->errorInfo(), false); |
|
| 777 | 777 | $this->debug->displayError($error, false); |
| 778 | 778 | |
| 779 | 779 | throw new DBConnectException($error, 101); |
@@ -790,7 +790,7 @@ discard block |
||
| 790 | 790 | $this->connected = $this->doctrine_connection->isConnected(); |
| 791 | 791 | |
| 792 | 792 | if (!$this->connected) { |
| 793 | - $error = 'Error connecting to mysql server: ' . \print_r($this->doctrine_connection->errorInfo(), false); |
|
| 793 | + $error = 'Error connecting to mysql server: '.\print_r($this->doctrine_connection->errorInfo(), false); |
|
| 794 | 794 | $this->debug->displayError($error, false); |
| 795 | 795 | |
| 796 | 796 | throw new DBConnectException($error, 101); |
@@ -850,10 +850,10 @@ discard block |
||
| 850 | 850 | $this->database, |
| 851 | 851 | $this->port, |
| 852 | 852 | $this->socket, |
| 853 | - (int) $flags |
|
| 853 | + (int)$flags |
|
| 854 | 854 | ); |
| 855 | 855 | } catch (\Exception $e) { |
| 856 | - $error = 'Error connecting to mysql server: ' . $e->getMessage(); |
|
| 856 | + $error = 'Error connecting to mysql server: '.$e->getMessage(); |
|
| 857 | 857 | $this->debug->displayError($error, false); |
| 858 | 858 | |
| 859 | 859 | throw new DBConnectException($error, 100, $e); |
@@ -862,7 +862,7 @@ discard block |
||
| 862 | 862 | |
| 863 | 863 | $errno = \mysqli_connect_errno(); |
| 864 | 864 | if (!$this->connected || $errno) { |
| 865 | - $error = 'Error connecting to mysql server: ' . \mysqli_connect_error() . ' (' . $errno . ')'; |
|
| 865 | + $error = 'Error connecting to mysql server: '.\mysqli_connect_error().' ('.$errno.')'; |
|
| 866 | 866 | $this->debug->displayError($error, false); |
| 867 | 867 | |
| 868 | 868 | throw new DBConnectException($error, 101); |
@@ -905,10 +905,10 @@ discard block |
||
| 905 | 905 | } |
| 906 | 906 | |
| 907 | 907 | if ($databaseName) { |
| 908 | - $databaseName = $this->quote_string(\trim($databaseName)) . '.'; |
|
| 908 | + $databaseName = $this->quote_string(\trim($databaseName)).'.'; |
|
| 909 | 909 | } |
| 910 | 910 | |
| 911 | - $sql = 'DELETE FROM ' . $databaseName . $this->quote_string($table) . " WHERE (${WHERE})"; |
|
| 911 | + $sql = 'DELETE FROM '.$databaseName.$this->quote_string($table)." WHERE (${WHERE})"; |
|
| 912 | 912 | |
| 913 | 913 | $return = $this->query($sql); |
| 914 | 914 | |
@@ -1005,14 +1005,14 @@ discard block |
||
| 1005 | 1005 | $var = $var->format('Y-m-d H:i:s'); |
| 1006 | 1006 | $type = 'string'; |
| 1007 | 1007 | } elseif (\method_exists($var, '__toString')) { |
| 1008 | - $var = (string) $var; |
|
| 1008 | + $var = (string)$var; |
|
| 1009 | 1009 | $type = 'string'; |
| 1010 | 1010 | } |
| 1011 | 1011 | } |
| 1012 | 1012 | |
| 1013 | 1013 | switch ($type) { |
| 1014 | 1014 | case 'boolean': |
| 1015 | - $var = (int) $var; |
|
| 1015 | + $var = (int)$var; |
|
| 1016 | 1016 | |
| 1017 | 1017 | break; |
| 1018 | 1018 | |
@@ -1055,7 +1055,7 @@ discard block |
||
| 1055 | 1055 | } |
| 1056 | 1056 | } else { |
| 1057 | 1057 | $varCleaned = []; |
| 1058 | - foreach ((array) $var as $key => $value) { |
|
| 1058 | + foreach ((array)$var as $key => $value) { |
|
| 1059 | 1059 | $key = $this->escape($key, $stripe_non_utf8, $html_entity_decode); |
| 1060 | 1060 | $value = $this->escape($value, $stripe_non_utf8, $html_entity_decode); |
| 1061 | 1061 | |
@@ -1121,7 +1121,7 @@ discard block |
||
| 1121 | 1121 | |
| 1122 | 1122 | if ($useCache) { |
| 1123 | 1123 | $cache = new Cache(null, null, false, $useCache); |
| 1124 | - $cacheKey = 'sql-' . \md5($query); |
|
| 1124 | + $cacheKey = 'sql-'.\md5($query); |
|
| 1125 | 1125 | |
| 1126 | 1126 | if ( |
| 1127 | 1127 | $cache->getCacheIsReady() |
@@ -1294,7 +1294,7 @@ discard block |
||
| 1294 | 1294 | } |
| 1295 | 1295 | |
| 1296 | 1296 | if ( |
| 1297 | - '' . $hostname . $username . $password . $database . $port . $charset === '' . $port . $charset |
|
| 1297 | + ''.$hostname.$username.$password.$database.$port.$charset === ''.$port.$charset |
|
| 1298 | 1298 | && |
| 1299 | 1299 | $firstInstance instanceof self |
| 1300 | 1300 | ) { |
@@ -1310,13 +1310,13 @@ discard block |
||
| 1310 | 1310 | if (\is_object($extra_config_value)) { |
| 1311 | 1311 | $extra_config_value_tmp = \spl_object_hash($extra_config_value); |
| 1312 | 1312 | } else { |
| 1313 | - $extra_config_value_tmp = (string) $extra_config_value; |
|
| 1313 | + $extra_config_value_tmp = (string)$extra_config_value; |
|
| 1314 | 1314 | } |
| 1315 | - $extra_config_string .= $extra_config_key . $extra_config_value_tmp; |
|
| 1315 | + $extra_config_string .= $extra_config_key.$extra_config_value_tmp; |
|
| 1316 | 1316 | } |
| 1317 | 1317 | |
| 1318 | 1318 | $connection = \md5( |
| 1319 | - $hostname . $username . $password . $database . $port . $charset . (int) $exit_on_error . (int) $echo_on_error . $logger_class_name . $logger_level . $extra_config_string |
|
| 1319 | + $hostname.$username.$password.$database.$port.$charset.(int)$exit_on_error.(int)$echo_on_error.$logger_class_name.$logger_level.$extra_config_string |
|
| 1320 | 1320 | ); |
| 1321 | 1321 | |
| 1322 | 1322 | if (!isset($instance[$connection])) { |
@@ -1456,10 +1456,10 @@ discard block |
||
| 1456 | 1456 | $SET = $this->_parseArrayPair($data); |
| 1457 | 1457 | |
| 1458 | 1458 | if ($databaseName) { |
| 1459 | - $databaseName = $this->quote_string(\trim($databaseName)) . '.'; |
|
| 1459 | + $databaseName = $this->quote_string(\trim($databaseName)).'.'; |
|
| 1460 | 1460 | } |
| 1461 | 1461 | |
| 1462 | - $sql = 'INSERT INTO ' . $databaseName . $this->quote_string($table) . " SET ${SET}"; |
|
| 1462 | + $sql = 'INSERT INTO '.$databaseName.$this->quote_string($table)." SET ${SET}"; |
|
| 1463 | 1463 | |
| 1464 | 1464 | $return = $this->query($sql); |
| 1465 | 1465 | if ($return === false) { |
@@ -1988,12 +1988,12 @@ discard block |
||
| 1988 | 1988 | |
| 1989 | 1989 | // exit if we have more then 3 "DB server has gone away"-errors |
| 1990 | 1990 | if ($RECONNECT_COUNTER > 3) { |
| 1991 | - $this->debug->mailToAdmin('DB-Fatal-Error', $errorMessage . '(' . $errorNumber . ') ' . ":\n<br />" . $sql, 5); |
|
| 1991 | + $this->debug->mailToAdmin('DB-Fatal-Error', $errorMessage.'('.$errorNumber.') '.":\n<br />".$sql, 5); |
|
| 1992 | 1992 | |
| 1993 | 1993 | throw new DBGoneAwayException($errorMessage); |
| 1994 | 1994 | } |
| 1995 | 1995 | |
| 1996 | - $this->debug->mailToAdmin('DB-Error', $errorMessage . '(' . $errorNumber . ') ' . ":\n<br />" . $sql); |
|
| 1996 | + $this->debug->mailToAdmin('DB-Error', $errorMessage.'('.$errorNumber.') '.":\n<br />".$sql); |
|
| 1997 | 1997 | |
| 1998 | 1998 | // reconnect |
| 1999 | 1999 | $RECONNECT_COUNTER++; |
@@ -2007,7 +2007,7 @@ discard block |
||
| 2007 | 2007 | return false; |
| 2008 | 2008 | } |
| 2009 | 2009 | |
| 2010 | - $this->debug->mailToAdmin('SQL-Error', $errorMessage . '(' . $errorNumber . ') ' . ":\n<br />" . $sql); |
|
| 2010 | + $this->debug->mailToAdmin('SQL-Error', $errorMessage.'('.$errorNumber.') '.":\n<br />".$sql); |
|
| 2011 | 2011 | |
| 2012 | 2012 | $force_exception_after_error = null; // auto |
| 2013 | 2013 | if ($this->in_transaction) { |
@@ -2015,7 +2015,7 @@ discard block |
||
| 2015 | 2015 | } |
| 2016 | 2016 | // this query returned an error, we must display it (only for dev) !!! |
| 2017 | 2017 | |
| 2018 | - $this->debug->displayError($errorMessage . '(' . $errorNumber . ') ' . ' | ' . $sql, $force_exception_after_error); |
|
| 2018 | + $this->debug->displayError($errorMessage.'('.$errorNumber.') '.' | '.$sql, $force_exception_after_error); |
|
| 2019 | 2019 | |
| 2020 | 2020 | return false; |
| 2021 | 2021 | } |
@@ -2033,12 +2033,12 @@ discard block |
||
| 2033 | 2033 | '`', |
| 2034 | 2034 | '``', |
| 2035 | 2035 | \trim( |
| 2036 | - (string) $this->escape($str, false), |
|
| 2036 | + (string)$this->escape($str, false), |
|
| 2037 | 2037 | '`' |
| 2038 | 2038 | ) |
| 2039 | 2039 | ); |
| 2040 | 2040 | |
| 2041 | - return '`' . $str . '`'; |
|
| 2041 | + return '`'.$str.'`'; |
|
| 2042 | 2042 | } |
| 2043 | 2043 | |
| 2044 | 2044 | /** |
@@ -2109,10 +2109,10 @@ discard block |
||
| 2109 | 2109 | $values = \implode(',', $data); |
| 2110 | 2110 | |
| 2111 | 2111 | if ($databaseName) { |
| 2112 | - $databaseName = $this->quote_string(\trim($databaseName)) . '.'; |
|
| 2112 | + $databaseName = $this->quote_string(\trim($databaseName)).'.'; |
|
| 2113 | 2113 | } |
| 2114 | 2114 | |
| 2115 | - $sql = 'REPLACE INTO ' . $databaseName . $this->quote_string($table) . " (${columns}) VALUES (${values})"; |
|
| 2115 | + $sql = 'REPLACE INTO '.$databaseName.$this->quote_string($table)." (${columns}) VALUES (${values})"; |
|
| 2116 | 2116 | |
| 2117 | 2117 | $return = $this->query($sql); |
| 2118 | 2118 | \assert(\is_int($return) || $return === false); |
@@ -2211,7 +2211,7 @@ discard block |
||
| 2211 | 2211 | } |
| 2212 | 2212 | } else { |
| 2213 | 2213 | $varCleaned = []; |
| 2214 | - foreach ((array) $var as $key => $value) { |
|
| 2214 | + foreach ((array)$var as $key => $value) { |
|
| 2215 | 2215 | $key = $this->escape($key, false, false, $convert_array); |
| 2216 | 2216 | $value = $this->secure($value); |
| 2217 | 2217 | |
@@ -2258,7 +2258,7 @@ discard block |
||
| 2258 | 2258 | $var = $this->escape($var, false, false, null); |
| 2259 | 2259 | |
| 2260 | 2260 | if (\is_string($var)) { |
| 2261 | - $var = "'" . \trim($var, "'") . "'"; |
|
| 2261 | + $var = "'".\trim($var, "'")."'"; |
|
| 2262 | 2262 | } |
| 2263 | 2263 | |
| 2264 | 2264 | return $var; |
@@ -2296,10 +2296,10 @@ discard block |
||
| 2296 | 2296 | } |
| 2297 | 2297 | |
| 2298 | 2298 | if ($databaseName) { |
| 2299 | - $databaseName = $this->quote_string(\trim($databaseName)) . '.'; |
|
| 2299 | + $databaseName = $this->quote_string(\trim($databaseName)).'.'; |
|
| 2300 | 2300 | } |
| 2301 | 2301 | |
| 2302 | - $sql = 'SELECT * FROM ' . $databaseName . $this->quote_string($table) . " WHERE (${WHERE})"; |
|
| 2302 | + $sql = 'SELECT * FROM '.$databaseName.$this->quote_string($table)." WHERE (${WHERE})"; |
|
| 2303 | 2303 | |
| 2304 | 2304 | $return = $this->query($sql); |
| 2305 | 2305 | \assert($return instanceof Result || $return === false); |
@@ -2348,7 +2348,7 @@ discard block |
||
| 2348 | 2348 | public function setConfigExtra(array $extra_config) |
| 2349 | 2349 | { |
| 2350 | 2350 | if (isset($extra_config['session_to_db'])) { |
| 2351 | - $this->session_to_db = (bool) $extra_config['session_to_db']; |
|
| 2351 | + $this->session_to_db = (bool)$extra_config['session_to_db']; |
|
| 2352 | 2352 | } |
| 2353 | 2353 | |
| 2354 | 2354 | if (isset($extra_config['doctrine'])) { |
@@ -2407,9 +2407,9 @@ discard block |
||
| 2407 | 2407 | $return = \mysqli_set_charset($this->mysqli_link, $charset); |
| 2408 | 2408 | |
| 2409 | 2409 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
| 2410 | - @\mysqli_query($this->mysqli_link, 'SET CHARACTER SET ' . $charset); |
|
| 2410 | + @\mysqli_query($this->mysqli_link, 'SET CHARACTER SET '.$charset); |
|
| 2411 | 2411 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
| 2412 | - @\mysqli_query($this->mysqli_link, "SET NAMES '" . $charset . "'"); |
|
| 2412 | + @\mysqli_query($this->mysqli_link, "SET NAMES '".$charset."'"); |
|
| 2413 | 2413 | } elseif ($this->doctrine_connection && $this->isDoctrinePDOConnection()) { |
| 2414 | 2414 | $doctrineWrappedConnection = $this->getDoctrinePDOConnection(); |
| 2415 | 2415 | if (!$doctrineWrappedConnection instanceof Connection) { |
@@ -2417,9 +2417,9 @@ discard block |
||
| 2417 | 2417 | } |
| 2418 | 2418 | |
| 2419 | 2419 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
| 2420 | - @$doctrineWrappedConnection->exec('SET CHARACTER SET ' . $charset); |
|
| 2420 | + @$doctrineWrappedConnection->exec('SET CHARACTER SET '.$charset); |
|
| 2421 | 2421 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
| 2422 | - @$doctrineWrappedConnection->exec("SET NAMES '" . $charset . "'"); |
|
| 2422 | + @$doctrineWrappedConnection->exec("SET NAMES '".$charset."'"); |
|
| 2423 | 2423 | |
| 2424 | 2424 | $return = true; |
| 2425 | 2425 | } else { |
@@ -2560,7 +2560,7 @@ discard block |
||
| 2560 | 2560 | */ |
| 2561 | 2561 | public function table_exists(string $table): bool |
| 2562 | 2562 | { |
| 2563 | - $check = $this->query('SELECT 1 FROM ' . $this->quote_string($table)); |
|
| 2563 | + $check = $this->query('SELECT 1 FROM '.$this->quote_string($table)); |
|
| 2564 | 2564 | |
| 2565 | 2565 | return $check !== false |
| 2566 | 2566 | && |
@@ -2591,7 +2591,7 @@ discard block |
||
| 2591 | 2591 | $result = $callback($this); |
| 2592 | 2592 | if ($result === false) { |
| 2593 | 2593 | /** @noinspection ThrowRawExceptionInspection */ |
| 2594 | - throw new \Exception('call_user_func [' . \print_r($callback, true) . '] === false'); |
|
| 2594 | + throw new \Exception('call_user_func ['.\print_r($callback, true).'] === false'); |
|
| 2595 | 2595 | } |
| 2596 | 2596 | |
| 2597 | 2597 | return $this->commit(); |
@@ -2649,10 +2649,10 @@ discard block |
||
| 2649 | 2649 | } |
| 2650 | 2650 | |
| 2651 | 2651 | if ($databaseName) { |
| 2652 | - $databaseName = $this->quote_string(\trim($databaseName)) . '.'; |
|
| 2652 | + $databaseName = $this->quote_string(\trim($databaseName)).'.'; |
|
| 2653 | 2653 | } |
| 2654 | 2654 | |
| 2655 | - $sql = 'UPDATE ' . $databaseName . $this->quote_string($table) . " SET ${SET} WHERE (${WHERE})"; |
|
| 2655 | + $sql = 'UPDATE '.$databaseName.$this->quote_string($table)." SET ${SET} WHERE (${WHERE})"; |
|
| 2656 | 2656 | |
| 2657 | 2657 | $return = $this->query($sql); |
| 2658 | 2658 | \assert(\is_int($return) || $return === false); |
@@ -927,7 +927,7 @@ discard block |
||
| 927 | 927 | /** |
| 928 | 928 | * Fetch as object. |
| 929 | 929 | * |
| 930 | - * @param object|string $class <p> |
|
| 930 | + * @param string $class <p> |
|
| 931 | 931 | * <strong>string</strong>: create a new object (with optional constructor |
| 932 | 932 | * parameter)<br> |
| 933 | 933 | * <strong>object</strong>: use a object and fill the the data into |
@@ -1056,7 +1056,7 @@ discard block |
||
| 1056 | 1056 | /** |
| 1057 | 1057 | * Fetch as "\Generator" via yield. |
| 1058 | 1058 | * |
| 1059 | - * @param object|string $class <p> |
|
| 1059 | + * @param string $class <p> |
|
| 1060 | 1060 | * <strong>string</strong>: create a new object (with optional constructor |
| 1061 | 1061 | * parameter)<br> |
| 1062 | 1062 | * <strong>object</strong>: use a object and fill the the data into |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | && |
| 149 | 149 | !$result instanceof \Doctrine\DBAL\Statement |
| 150 | 150 | ) { |
| 151 | - throw new \InvalidArgumentException('$result must be ' . \mysqli_result::class . ' or ' . \Doctrine\DBAL\Statement::class . ' !'); |
|
| 151 | + throw new \InvalidArgumentException('$result must be '.\mysqli_result::class.' or '.\Doctrine\DBAL\Statement::class.' !'); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | $this->_result = $result; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | $this->num_rows = $this->_result->rowCount(); |
| 172 | 172 | } else { |
| 173 | - $this->num_rows = (int) $this->_result->num_rows; |
|
| 173 | + $this->num_rows = (int)$this->_result->num_rows; |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | $this->current_row = 0; |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | public function __toString() |
| 213 | 213 | { |
| 214 | - return (string) $this->num_rows; |
|
| 214 | + return (string)$this->num_rows; |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | /** |
@@ -521,7 +521,7 @@ discard block |
||
| 521 | 521 | $this->reset(); |
| 522 | 522 | |
| 523 | 523 | return Arrayy::createFromGeneratorFunction( |
| 524 | - function () { |
|
| 524 | + function() { |
|
| 525 | 525 | /** @noinspection PhpAssignmentInConditionInspection */ |
| 526 | 526 | while ($row = $this->fetch_assoc()) { |
| 527 | 527 | yield $this->cast($row); |
@@ -878,8 +878,8 @@ discard block |
||
| 878 | 878 | |
| 879 | 879 | if ($as_array) { |
| 880 | 880 | return \array_map( |
| 881 | - static function ($object) { |
|
| 882 | - return (array) $object; |
|
| 881 | + static function($object) { |
|
| 882 | + return (array)$object; |
|
| 883 | 883 | }, |
| 884 | 884 | $fields |
| 885 | 885 | ); |
@@ -1046,7 +1046,7 @@ discard block |
||
| 1046 | 1046 | } |
| 1047 | 1047 | |
| 1048 | 1048 | return \array_map( |
| 1049 | - static function ($values) use ($keys) { |
|
| 1049 | + static function($values) use ($keys) { |
|
| 1050 | 1050 | return \array_combine($keys, $values); |
| 1051 | 1051 | }, |
| 1052 | 1052 | $rows |
@@ -1184,7 +1184,7 @@ discard block |
||
| 1184 | 1184 | $fieldTmp->{$metadataTmpKey} = $metadataTmpValue; |
| 1185 | 1185 | } |
| 1186 | 1186 | |
| 1187 | - $typeNativeTmp = 'MYSQL_TYPE_' . $metadataTmp['native_type']; |
|
| 1187 | + $typeNativeTmp = 'MYSQL_TYPE_'.$metadataTmp['native_type']; |
|
| 1188 | 1188 | $typeTmp = $THIS_CLASS_TMP->getConstant($typeNativeTmp); |
| 1189 | 1189 | if ($typeTmp) { |
| 1190 | 1190 | $fieldTmp->type = $typeTmp; |
@@ -1533,11 +1533,11 @@ discard block |
||
| 1533 | 1533 | if (\abs($offset) > $this->num_rows) { |
| 1534 | 1534 | $offset = 0; |
| 1535 | 1535 | } else { |
| 1536 | - $offset = $this->num_rows - (int) \abs($offset); |
|
| 1536 | + $offset = $this->num_rows - (int)\abs($offset); |
|
| 1537 | 1537 | } |
| 1538 | 1538 | } |
| 1539 | 1539 | |
| 1540 | - $length = $length !== null ? (int) $length : $this->num_rows; |
|
| 1540 | + $length = $length !== null ? (int)$length : $this->num_rows; |
|
| 1541 | 1541 | $n = 0; |
| 1542 | 1542 | for ($i = $offset; $i < $this->num_rows && $n < $length; $i++) { |
| 1543 | 1543 | if ($preserve_keys) { |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | } else { |
| 87 | 87 | |
| 88 | 88 | // for testing with dev-address |
| 89 | - $noDev = isset($_GET['noDev']) ? (int) $_GET['noDev'] : 0; |
|
| 89 | + $noDev = isset($_GET['noDev']) ? (int)$_GET['noDev'] : 0; |
|
| 90 | 90 | $remoteIpAddress = $_SERVER['REMOTE_ADDR'] ?? false; |
| 91 | 91 | |
| 92 | 92 | if ( |
@@ -137,9 +137,9 @@ discard block |
||
| 137 | 137 | $this->logger( |
| 138 | 138 | [ |
| 139 | 139 | 'error', |
| 140 | - '<strong>' . \date( |
|
| 140 | + '<strong>'.\date( |
|
| 141 | 141 | 'd. m. Y G:i:s' |
| 142 | - ) . ' (' . $fileInfo['file'] . ' line: ' . $fileInfo['line'] . ') (sql-error):</strong> ' . $error . '<br>', |
|
| 142 | + ).' ('.$fileInfo['file'].' line: '.$fileInfo['line'].') (sql-error):</strong> '.$error.'<br>', |
|
| 143 | 143 | ] |
| 144 | 144 | ); |
| 145 | 145 | |
@@ -155,16 +155,16 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | if (\PHP_SAPI === 'cli') { |
| 157 | 157 | echo "\n"; |
| 158 | - echo 'file:line -> ' . $fileInfo['file'] . ':' . $fileInfo['line'] . "\n"; |
|
| 159 | - echo 'error: ' . \str_replace(["\r\n", "\n", "\r"], '', $error); |
|
| 158 | + echo 'file:line -> '.$fileInfo['file'].':'.$fileInfo['line']."\n"; |
|
| 159 | + echo 'error: '.\str_replace(["\r\n", "\n", "\r"], '', $error); |
|
| 160 | 160 | echo "\n"; |
| 161 | 161 | } else { |
| 162 | 162 | echo ' |
| 163 | - <div class="OBJ-mysql-box" style="border: ' . $box_border . '; background: ' . $box_bg . '; padding: 10px; margin: 10px;"> |
|
| 163 | + <div class="OBJ-mysql-box" style="border: ' . $box_border.'; background: '.$box_bg.'; padding: 10px; margin: 10px;"> |
|
| 164 | 164 | <b style="font-size: 14px;">MYSQL Error:</b> |
| 165 | 165 | <code style="display: block;"> |
| 166 | - file:line -> ' . $fileInfo['file'] . ':' . $fileInfo['line'] . ' |
|
| 167 | - ' . $error . ' |
|
| 166 | + file:line -> ' . $fileInfo['file'].':'.$fileInfo['line'].' |
|
| 167 | + ' . $error.' |
|
| 168 | 168 | </code> |
| 169 | 169 | </div> |
| 170 | 170 | '; |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
| 306 | 306 | $infoExtra = @\mysqli_info($tmpLink); |
| 307 | 307 | if ($infoExtra) { |
| 308 | - $infoExtra = ' | info => ' . $infoExtra; |
|
| 308 | + $infoExtra = ' | info => '.$infoExtra; |
|
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | |
@@ -313,14 +313,14 @@ discard block |
||
| 313 | 313 | // logging |
| 314 | 314 | // |
| 315 | 315 | |
| 316 | - $info = 'time => ' . \round($duration, 5) . ' | results => ' . print_r($results, true) . $infoExtra . ' | SQL => ' . UTF8::htmlentities($sql); |
|
| 316 | + $info = 'time => '.\round($duration, 5).' | results => '.print_r($results, true).$infoExtra.' | SQL => '.UTF8::htmlentities($sql); |
|
| 317 | 317 | |
| 318 | 318 | $fileInfo = $this->getFileAndLineFromSql(); |
| 319 | 319 | |
| 320 | 320 | return $this->logger( |
| 321 | 321 | [ |
| 322 | 322 | $logLevel, |
| 323 | - '<strong>' . \date('d. m. Y G:i:s') . ' (' . $fileInfo['file'] . ' line: ' . $fileInfo['line'] . '):</strong> ' . $info . '<br>', |
|
| 323 | + '<strong>'.\date('d. m. Y G:i:s').' ('.$fileInfo['file'].' line: '.$fileInfo['line'].'):</strong> '.$info.'<br>', |
|
| 324 | 324 | 'sql', |
| 325 | 325 | ] |
| 326 | 326 | ); |
@@ -393,21 +393,21 @@ discard block |
||
| 393 | 393 | $this->logger( |
| 394 | 394 | [ |
| 395 | 395 | 'debug', |
| 396 | - $subject . ' | ' . $htmlBody, |
|
| 396 | + $subject.' | '.$htmlBody, |
|
| 397 | 397 | ] |
| 398 | 398 | ); |
| 399 | 399 | } elseif ($priority > 3) { |
| 400 | 400 | $this->logger( |
| 401 | 401 | [ |
| 402 | 402 | 'error', |
| 403 | - $subject . ' | ' . $htmlBody, |
|
| 403 | + $subject.' | '.$htmlBody, |
|
| 404 | 404 | ] |
| 405 | 405 | ); |
| 406 | 406 | } elseif ($priority < 3) { |
| 407 | 407 | $this->logger( |
| 408 | 408 | [ |
| 409 | 409 | 'info', |
| 410 | - $subject . ' | ' . $htmlBody, |
|
| 410 | + $subject.' | '.$htmlBody, |
|
| 411 | 411 | ] |
| 412 | 412 | ); |
| 413 | 413 | } |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | */ |
| 420 | 420 | public function setEchoOnError($echo_on_error) |
| 421 | 421 | { |
| 422 | - $this->echo_on_error = (bool) $echo_on_error; |
|
| 422 | + $this->echo_on_error = (bool)$echo_on_error; |
|
| 423 | 423 | } |
| 424 | 424 | |
| 425 | 425 | /** |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | */ |
| 428 | 428 | public function setExitOnError($exit_on_error) |
| 429 | 429 | { |
| 430 | - $this->exit_on_error = (bool) $exit_on_error; |
|
| 430 | + $this->exit_on_error = (bool)$exit_on_error; |
|
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | /** |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | */ |
| 436 | 436 | public function setLoggerClassName($logger_class_name) |
| 437 | 437 | { |
| 438 | - $this->logger_class_name = (string) $logger_class_name; |
|
| 438 | + $this->logger_class_name = (string)$logger_class_name; |
|
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | /** |
@@ -443,6 +443,6 @@ discard block |
||
| 443 | 443 | */ |
| 444 | 444 | public function setLoggerLevel($logger_level) |
| 445 | 445 | { |
| 446 | - $this->logger_level = (string) $logger_level; |
|
| 446 | + $this->logger_level = (string)$logger_level; |
|
| 447 | 447 | } |
| 448 | 448 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $configOrig = $dbConnection->getConfig(); |
| 26 | 26 | \array_walk_recursive( |
| 27 | 27 | $configOrig, |
| 28 | - static function ($k, $v) use (&$configTmp) { |
|
| 28 | + static function($k, $v) use (&$configTmp) { |
|
| 29 | 29 | $configTmp[] = $v; |
| 30 | 30 | $configTmp[] = $k; |
| 31 | 31 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $optimized = 0; |
| 52 | 52 | if (!empty($tables)) { |
| 53 | 53 | foreach ($tables as $table) { |
| 54 | - $optimize = 'OPTIMIZE TABLE ' . $dbConnection->quote_string($table); |
|
| 54 | + $optimize = 'OPTIMIZE TABLE '.$dbConnection->quote_string($table); |
|
| 55 | 55 | $result = $dbConnection->query($optimize); |
| 56 | 56 | if ($result) { |
| 57 | 57 | $optimized++; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $optimized = 0; |
| 80 | 80 | if (!empty($tables)) { |
| 81 | 81 | foreach ($tables as $table) { |
| 82 | - $optimize = 'REPAIR TABLE ' . $dbConnection->quote_string($table); |
|
| 82 | + $optimize = 'REPAIR TABLE '.$dbConnection->quote_string($table); |
|
| 83 | 83 | $result = $dbConnection->query($optimize); |
| 84 | 84 | if ($result) { |
| 85 | 85 | $optimized++; |
@@ -213,23 +213,23 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | $whereSQL = $dbConnection->_parseArrayPair($whereArray, 'AND'); |
| 215 | 215 | if ($whereSQL) { |
| 216 | - $whereSQL = 'AND ' . $whereSQL; |
|
| 216 | + $whereSQL = 'AND '.$whereSQL; |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | if ($databaseName) { |
| 220 | - $databaseName = $dbConnection->quote_string(\trim($databaseName)) . '.'; |
|
| 220 | + $databaseName = $dbConnection->quote_string(\trim($databaseName)).'.'; |
|
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | // get the row |
| 224 | - $query = 'SELECT ' . $dbConnection->quote_string($searchFieldName) . ', ' . $dbConnection->quote_string($idFieldName) . ' |
|
| 225 | - FROM ' . $databaseName . $dbConnection->quote_string($table) . ' |
|
| 224 | + $query = 'SELECT '.$dbConnection->quote_string($searchFieldName).', '.$dbConnection->quote_string($idFieldName).' |
|
| 225 | + FROM ' . $databaseName.$dbConnection->quote_string($table).' |
|
| 226 | 226 | WHERE 1 = 1 |
| 227 | - ' . $whereSQL . ' |
|
| 227 | + ' . $whereSQL.' |
|
| 228 | 228 | '; |
| 229 | 229 | |
| 230 | 230 | if ($useCache) { |
| 231 | 231 | $cache = new Cache(null, null, false, $useCache); |
| 232 | - $cacheKey = 'sql-phonetic-search-' . \md5($query); |
|
| 232 | + $cacheKey = 'sql-phonetic-search-'.\md5($query); |
|
| 233 | 233 | |
| 234 | 234 | if ( |
| 235 | 235 | $cache->getCacheIsReady() |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | return ''; |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | - return $MYSQL_CLIENT_VERSION_CACHE[$cacheKey] = (string) \mysqli_get_client_version($mysqli_link); |
|
| 316 | + return $MYSQL_CLIENT_VERSION_CACHE[$cacheKey] = (string)\mysqli_get_client_version($mysqli_link); |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | /** |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | if ($doctrineConnection) { |
| 342 | 342 | $doctrineWrappedConnection = $doctrineConnection->getWrappedConnection(); |
| 343 | 343 | if ($doctrineWrappedConnection instanceof \Doctrine\DBAL\Driver\PDOConnection) { |
| 344 | - return $MYSQL_SERVER_VERSION_CACHE[$cacheKey] = (string) $doctrineWrappedConnection->getServerVersion(); |
|
| 344 | + return $MYSQL_SERVER_VERSION_CACHE[$cacheKey] = (string)$doctrineWrappedConnection->getServerVersion(); |
|
| 345 | 345 | } |
| 346 | 346 | } |
| 347 | 347 | |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | return ''; |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | - return $MYSQL_SERVER_VERSION_CACHE[$cacheKey] = (string) \mysqli_get_server_version($mysqli_link); |
|
| 353 | + return $MYSQL_SERVER_VERSION_CACHE[$cacheKey] = (string)\mysqli_get_server_version($mysqli_link); |
|
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | /** |
@@ -391,10 +391,10 @@ discard block |
||
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | if ($databaseName) { |
| 394 | - $databaseName = $dbConnection->quote_string(\trim($databaseName)) . '.'; |
|
| 394 | + $databaseName = $dbConnection->quote_string(\trim($databaseName)).'.'; |
|
| 395 | 395 | } |
| 396 | 396 | |
| 397 | - $sql = 'SHOW COLUMNS FROM ' . $databaseName . $dbConnection->escape($table); |
|
| 397 | + $sql = 'SHOW COLUMNS FROM '.$databaseName.$dbConnection->escape($table); |
|
| 398 | 398 | $result = $dbConnection->query($sql); |
| 399 | 399 | |
| 400 | 400 | if ($result instanceof Result && $result->num_rows > 0) { |
@@ -446,17 +446,17 @@ discard block |
||
| 446 | 446 | |
| 447 | 447 | $whereSQL = $dbConnection->_parseArrayPair($whereArray, 'AND'); |
| 448 | 448 | if ($whereSQL) { |
| 449 | - $whereSQL = 'AND ' . $whereSQL; |
|
| 449 | + $whereSQL = 'AND '.$whereSQL; |
|
| 450 | 450 | } |
| 451 | 451 | |
| 452 | 452 | if ($databaseName) { |
| 453 | - $databaseName = $dbConnection->quote_string(\trim($databaseName)) . '.'; |
|
| 453 | + $databaseName = $dbConnection->quote_string(\trim($databaseName)).'.'; |
|
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | // get the row |
| 457 | - $query = 'SELECT * FROM ' . $databaseName . $dbConnection->quote_string($table) . ' |
|
| 457 | + $query = 'SELECT * FROM '.$databaseName.$dbConnection->quote_string($table).' |
|
| 458 | 458 | WHERE 1 = 1 |
| 459 | - ' . $whereSQL . ' |
|
| 459 | + ' . $whereSQL.' |
|
| 460 | 460 | '; |
| 461 | 461 | $result = $dbConnection->query($query); |
| 462 | 462 | |
@@ -475,11 +475,11 @@ discard block |
||
| 475 | 475 | foreach ($tmpArray as $fieldName => $value) { |
| 476 | 476 | if (!\in_array($fieldName, $ignoreArray, true)) { |
| 477 | 477 | if (\array_key_exists($fieldName, $updateArray)) { |
| 478 | - $insert_keys .= ',' . $fieldName; |
|
| 478 | + $insert_keys .= ','.$fieldName; |
|
| 479 | 479 | $insert_values .= ',?'; |
| 480 | 480 | $bindings[] = $updateArray[$fieldName]; // INFO: do not escape non selected data |
| 481 | 481 | } else { |
| 482 | - $insert_keys .= ',' . $fieldName; |
|
| 482 | + $insert_keys .= ','.$fieldName; |
|
| 483 | 483 | $insert_values .= ',?'; |
| 484 | 484 | $bindings[] = $value; // INFO: do not escape non selected data |
| 485 | 485 | } |
@@ -490,10 +490,10 @@ discard block |
||
| 490 | 490 | $insert_values = \ltrim($insert_values, ','); |
| 491 | 491 | |
| 492 | 492 | // insert the "copied" row |
| 493 | - $new_query = 'INSERT INTO ' . $databaseName . $dbConnection->quote_string($table) . ' |
|
| 494 | - (' . $insert_keys . ') |
|
| 493 | + $new_query = 'INSERT INTO '.$databaseName.$dbConnection->quote_string($table).' |
|
| 494 | + (' . $insert_keys.') |
|
| 495 | 495 | VALUES |
| 496 | - (' . $insert_values . ') |
|
| 496 | + (' . $insert_values.') |
|
| 497 | 497 | '; |
| 498 | 498 | |
| 499 | 499 | $return = $dbConnection->query($new_query, $bindings); |
@@ -101,11 +101,11 @@ discard block |
||
| 101 | 101 | $value = $this->_db->escape($value); |
| 102 | 102 | |
| 103 | 103 | if ($type === 's') { |
| 104 | - $valueForSqlWithBoundParameters = "'" . $value . "'"; |
|
| 104 | + $valueForSqlWithBoundParameters = "'".$value."'"; |
|
| 105 | 105 | } elseif ($type === 'i') { |
| 106 | - $valueForSqlWithBoundParameters = (int) $value; |
|
| 106 | + $valueForSqlWithBoundParameters = (int)$value; |
|
| 107 | 107 | } elseif ($type === 'd') { |
| 108 | - $valueForSqlWithBoundParameters = (float) $value; |
|
| 108 | + $valueForSqlWithBoundParameters = (float)$value; |
|
| 109 | 109 | } else { |
| 110 | 110 | $valueForSqlWithBoundParameters = $value; |
| 111 | 111 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | |
| 205 | 205 | // "INSERT" || "REPLACE" |
| 206 | 206 | if (\preg_match('/^\s*"?(INSERT|REPLACE)\s+/i', $this->_sql)) { |
| 207 | - $insert_id = (int) $this->insert_id; |
|
| 207 | + $insert_id = (int)$this->insert_id; |
|
| 208 | 208 | $this->_debug->logQuery($this->_sql_with_bound_parameters, $query_duration, $insert_id); |
| 209 | 209 | |
| 210 | 210 | return $insert_id; |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | |
| 213 | 213 | // "UPDATE" || "DELETE" |
| 214 | 214 | if (\preg_match('/^\s*"?(UPDATE|DELETE)\s+/i', $this->_sql)) { |
| 215 | - $affected_rows = (int) $this->affected_rows; |
|
| 215 | + $affected_rows = (int)$this->affected_rows; |
|
| 216 | 216 | $this->_debug->logQuery($this->_sql_with_bound_parameters, $query_duration, $affected_rows); |
| 217 | 217 | |
| 218 | 218 | return $affected_rows; |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | return $this->queryErrorHandling($this->error, $this->_sql_with_bound_parameters); |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | - $num_rows = (int) $select_result->num_rows; |
|
| 232 | + $num_rows = (int)$select_result->num_rows; |
|
| 233 | 233 | $this->_debug->logQuery($this->_sql_with_bound_parameters, $query_duration, $num_rows); |
| 234 | 234 | |
| 235 | 235 | return new Result($this->_sql_with_bound_parameters, $select_result); |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | public function prepare($query): bool |
| 289 | 289 | { |
| 290 | 290 | if (!is_string($query)) { |
| 291 | - throw new \InvalidArgumentException('$query was no string: ' . \gettype($query)); |
|
| 291 | + throw new \InvalidArgumentException('$query was no string: '.\gettype($query)); |
|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | $this->_sql = $query; |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | $bool = parent::prepare($query); |
| 308 | 308 | |
| 309 | 309 | if ($bool === false) { |
| 310 | - $this->_debug->displayError('Can not prepare query: ' . $query . ' | ' . $this->error, false); |
|
| 310 | + $this->_debug->displayError('Can not prepare query: '.$query.' | '.$this->error, false); |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | return $bool; |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | // we need to replace the question mark "?" here |
| 369 | 369 | $values[1] = \str_replace('?', '###simple_mysqli__prepare_question_mark###', $values[1]); |
| 370 | 370 | // build the query (only for debugging) |
| 371 | - $testQuery = (string) \preg_replace("/\?/", $values[1], $testQuery, 1); |
|
| 371 | + $testQuery = (string)\preg_replace("/\?/", $values[1], $testQuery, 1); |
|
| 372 | 372 | } |
| 373 | 373 | $testQuery = \str_replace('###simple_mysqli__prepare_question_mark###', '?', $testQuery); |
| 374 | 374 | } |
@@ -399,12 +399,12 @@ discard block |
||
| 399 | 399 | |
| 400 | 400 | // exit if we have more then 3 "DB server has gone away"-errors |
| 401 | 401 | if ($RECONNECT_COUNTER > 3) { |
| 402 | - $this->_debug->mailToAdmin('DB-Fatal-Error', $errorMsg . ":\n<br />" . $sql, 5); |
|
| 402 | + $this->_debug->mailToAdmin('DB-Fatal-Error', $errorMsg.":\n<br />".$sql, 5); |
|
| 403 | 403 | |
| 404 | 404 | throw new DBGoneAwayException($errorMsg); |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | - $this->_debug->mailToAdmin('DB-Error', $errorMsg . ":\n<br />" . $sql); |
|
| 407 | + $this->_debug->mailToAdmin('DB-Error', $errorMsg.":\n<br />".$sql); |
|
| 408 | 408 | |
| 409 | 409 | // reconnect |
| 410 | 410 | $RECONNECT_COUNTER++; |
@@ -414,10 +414,10 @@ discard block |
||
| 414 | 414 | return $this->execute(); |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | - $this->_debug->mailToAdmin('SQL-Error', $errorMsg . ":\n<br />" . $sql); |
|
| 417 | + $this->_debug->mailToAdmin('SQL-Error', $errorMsg.":\n<br />".$sql); |
|
| 418 | 418 | |
| 419 | 419 | // this query returned an error, we must display it (only for dev) !!! |
| 420 | - $this->_debug->displayError($errorMsg . ' | ' . $sql); |
|
| 420 | + $this->_debug->displayError($errorMsg.' | '.$sql); |
|
| 421 | 421 | |
| 422 | 422 | return false; |
| 423 | 423 | } |