Completed
Push — master ( e6ef76...cf76e4 )
by Lars
85:12 queued 61:06
created
src/voku/db/ActiveRecordExpressions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,6 +21,6 @@
 block discarded – undo
21 21
    */
22 22
   public function __toString()
23 23
   {
24
-    return $this->source . ' ' . $this->operator . ' ' . $this->target;
24
+    return $this->source.' '.$this->operator.' '.$this->target;
25 25
   }
26 26
 }
Please login to merge, or discard this patch.
src/voku/db/Result.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
   /**
437 437
    * Fetch all results as "\Generator" via yield.
438 438
    *
439
-   * @param object|string $class  <p>
439
+   * @param boolean $class  <p>
440 440
    *                              <strong>string</strong>: create a new object (with optional constructor
441 441
    *                              parameter)<br>
442 442
    *                              <strong>object</strong>: use a object and fill the the data into
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
   /**
865 865
    * Fetch as "\Generator" via yield.
866 866
    *
867
-   * @param object|string $class  <p>
867
+   * @param boolean $class  <p>
868 868
    *                              <strong>string</strong>: create a new object (with optional constructor
869 869
    *                              parameter)<br>
870 870
    *                              <strong>object</strong>: use a object and fill the the data into
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         &&
108 108
         !$result instanceof \Doctrine\DBAL\Statement
109 109
     ) {
110
-      throw new \InvalidArgumentException('$result must be ' . \mysqli_result::class . ' or ' . \Doctrine\DBAL\Statement::class . ' !');
110
+      throw new \InvalidArgumentException('$result must be '.\mysqli_result::class.' or '.\Doctrine\DBAL\Statement::class.' !');
111 111
     }
112 112
 
113 113
     $this->_result = $result;
@@ -812,7 +812,7 @@  discard block
 block discarded – undo
812 812
   {
813 813
     if ($as_array) {
814 814
       return \array_map(
815
-          function ($object) {
815
+          function($object) {
816 816
             return (array)$object;
817 817
           },
818 818
           $this->fetch_fields()
@@ -986,7 +986,7 @@  discard block
 block discarded – undo
986 986
     }
987 987
 
988 988
     return \array_map(
989
-        function ($values) use ($keys) {
989
+        function($values) use ($keys) {
990 990
           return \array_combine($keys, $values);
991 991
         }, $rows
992 992
     );
@@ -1102,7 +1102,7 @@  discard block
 block discarded – undo
1102 1102
           $fieldTmp->{$metadataTmpKey} = $metadataTmpValue;
1103 1103
         }
1104 1104
 
1105
-        $typeNativeTmp = 'MYSQL_TYPE_' . $metadataTmp['native_type'];
1105
+        $typeNativeTmp = 'MYSQL_TYPE_'.$metadataTmp['native_type'];
1106 1106
         $typeTmp = $THIS_CLASS_TMP->getConstant($typeNativeTmp);
1107 1107
         if ($typeTmp) {
1108 1108
           $fieldTmp->type = $typeTmp;
Please login to merge, or discard this patch.
src/voku/db/ActiveRecord.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -659,7 +659,7 @@
 block discarded – undo
659 659
    * @param array     $param          <p>
660 660
    *                                  The param will be bind to the $sql query.
661 661
    *                                  </p>
662
-   * @param null|self $obj            <p>
662
+   * @param null|\self $obj            <p>
663 663
    *                                  The object, if find record in database, we will assign the attributes into
664 664
    *                                  this object.
665 665
    *                                  </p>
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
         null === $active_record->{$sql_string_part}
416 416
     ) {
417 417
 
418
-      $sql_string_part = \strtoupper($sql_string_part) . ' ' . $active_record->table . '.*';
418
+      $sql_string_part = \strtoupper($sql_string_part).' '.$active_record->table.'.*';
419 419
 
420 420
     } elseif (
421 421
         (
@@ -427,15 +427,15 @@  discard block
 block discarded – undo
427 427
         null === $active_record->{$sql_string_part}
428 428
     ) {
429 429
 
430
-      $sql_string_part = \strtoupper($sql_string_part) . ' ' . $active_record->table;
430
+      $sql_string_part = \strtoupper($sql_string_part).' '.$active_record->table;
431 431
 
432 432
     } elseif ('delete' === $sql_string_part) {
433 433
 
434
-      $sql_string_part = \strtoupper($sql_string_part) . ' ';
434
+      $sql_string_part = \strtoupper($sql_string_part).' ';
435 435
 
436 436
     } else {
437 437
 
438
-      $sql_string_part = (null !== $active_record->{$sql_string_part}) ? $active_record->{$sql_string_part} . ' ' : '';
438
+      $sql_string_part = (null !== $active_record->{$sql_string_part}) ? $active_record->{$sql_string_part}.' ' : '';
439 439
 
440 440
     }
441 441
   }
@@ -451,10 +451,10 @@  discard block
 block discarded – undo
451 451
   {
452 452
     if (\is_array($value)) {
453 453
       foreach ($value as $key => $val) {
454
-        $this->params[$value[$key] = self::PREFIX . ++self::$count] = $val;
454
+        $this->params[$value[$key] = self::PREFIX.++self::$count] = $val;
455 455
       }
456 456
     } elseif (\is_string($value)) {
457
-      $this->params[$ph = self::PREFIX . ++self::$count] = $value;
457
+      $this->params[$ph = self::PREFIX.++self::$count] = $value;
458 458
       $value = $ph;
459 459
     }
460 460
 
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
     $value = $this->_filterParam($value);
476 476
     $expression = new ActiveRecordExpressions(
477 477
         [
478
-            'source'   => ('where' === strtolower($name) ? $this->table . '.' : '') . $field,
478
+            'source'   => ('where' === strtolower($name) ? $this->table.'.' : '').$field,
479 479
             'operator' => $operator,
480 480
             'target'   => \is_array($value)
481 481
                 ? new ActiveRecordExpressionsWrap(
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
     $value = $this->_filterParam($this->dirty);
940 940
     $this->insert = new ActiveRecordExpressions(
941 941
         [
942
-            'operator' => 'INSERT INTO ' . $this->table,
942
+            'operator' => 'INSERT INTO '.$this->table,
943 943
             'target'   => new ActiveRecordExpressionsWrap(['target' => \array_keys($this->dirty)]),
944 944
         ]
945 945
     );
@@ -985,7 +985,7 @@  discard block
 block discarded – undo
985 985
     $this->join = new ActiveRecordExpressions(
986 986
         [
987 987
             'source'   => $this->join ?: '',
988
-            'operator' => $type . ' JOIN',
988
+            'operator' => $type.' JOIN',
989 989
             'target'   => new ActiveRecordExpressions(
990 990
                 [
991 991
                     'source'   => $table,
Please login to merge, or discard this patch.
src/voku/db/Helper.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     $optimized = 0;
32 32
     if (!empty($tables)) {
33 33
       foreach ($tables as $table) {
34
-        $optimize = 'OPTIMIZE TABLE ' . $dbConnection->quote_string($table);
34
+        $optimize = 'OPTIMIZE TABLE '.$dbConnection->quote_string($table);
35 35
         $result = $dbConnection->query($optimize);
36 36
         if ($result) {
37 37
           $optimized++;
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     $optimized = 0;
60 60
     if (!empty($tables)) {
61 61
       foreach ($tables as $table) {
62
-        $optimize = 'REPAIR TABLE ' . $dbConnection->quote_string($table);
62
+        $optimize = 'REPAIR TABLE '.$dbConnection->quote_string($table);
63 63
         $result = $dbConnection->query($optimize);
64 64
         if ($result) {
65 65
           $optimized++;
@@ -176,23 +176,23 @@  discard block
 block discarded – undo
176 176
 
177 177
     $whereSQL = $dbConnection->_parseArrayPair($whereArray, 'AND');
178 178
     if ($whereSQL) {
179
-      $whereSQL = 'AND ' . $whereSQL;
179
+      $whereSQL = 'AND '.$whereSQL;
180 180
     }
181 181
 
182 182
     if ($databaseName) {
183
-      $databaseName = $dbConnection->quote_string(trim($databaseName)) . '.';
183
+      $databaseName = $dbConnection->quote_string(trim($databaseName)).'.';
184 184
     }
185 185
 
186 186
     // get the row
187
-    $query = 'SELECT ' . $dbConnection->quote_string($searchFieldName) . ', ' . $dbConnection->quote_string($idFieldName) . ' 
188
-      FROM ' . $databaseName . $dbConnection->quote_string($table) . '
187
+    $query = 'SELECT '.$dbConnection->quote_string($searchFieldName).', '.$dbConnection->quote_string($idFieldName).' 
188
+      FROM ' . $databaseName.$dbConnection->quote_string($table).'
189 189
       WHERE 1 = 1
190
-      ' . $whereSQL . '
190
+      ' . $whereSQL.'
191 191
     ';
192 192
 
193 193
     if ($useCache === true) {
194 194
       $cache = new Cache(null, null, false, $useCache);
195
-      $cacheKey = 'sql-phonetic-search-' . \md5($query);
195
+      $cacheKey = 'sql-phonetic-search-'.\md5($query);
196 196
 
197 197
       if (
198 198
           $cache->getCacheIsReady() === true
@@ -322,10 +322,10 @@  discard block
 block discarded – undo
322 322
     }
323 323
 
324 324
     if ($databaseName) {
325
-      $databaseName = $dbConnection->quote_string(trim($databaseName)) . '.';
325
+      $databaseName = $dbConnection->quote_string(trim($databaseName)).'.';
326 326
     }
327 327
 
328
-    $sql = 'SHOW COLUMNS FROM ' . $databaseName . $dbConnection->escape($table);
328
+    $sql = 'SHOW COLUMNS FROM '.$databaseName.$dbConnection->escape($table);
329 329
     $result = $dbConnection->query($sql);
330 330
 
331 331
     if ($result && $result->num_rows > 0) {
@@ -371,17 +371,17 @@  discard block
 block discarded – undo
371 371
 
372 372
     $whereSQL = $dbConnection->_parseArrayPair($whereArray, 'AND');
373 373
     if ($whereSQL) {
374
-      $whereSQL = 'AND ' . $whereSQL;
374
+      $whereSQL = 'AND '.$whereSQL;
375 375
     }
376 376
 
377 377
     if ($databaseName) {
378
-      $databaseName = $dbConnection->quote_string(trim($databaseName)) . '.';
378
+      $databaseName = $dbConnection->quote_string(trim($databaseName)).'.';
379 379
     }
380 380
 
381 381
     // get the row
382
-    $query = 'SELECT * FROM ' . $databaseName . $dbConnection->quote_string($table) . '
382
+    $query = 'SELECT * FROM '.$databaseName.$dbConnection->quote_string($table).'
383 383
       WHERE 1 = 1
384
-      ' . $whereSQL . '
384
+      ' . $whereSQL.'
385 385
     ';
386 386
     $result = $dbConnection->query($query);
387 387
 
@@ -401,11 +401,11 @@  discard block
 block discarded – undo
401 401
 
402 402
           if (!\in_array($fieldName, $ignoreArray, true)) {
403 403
             if (\array_key_exists($fieldName, $updateArray)) {
404
-              $insert_keys .= ',' . $fieldName;
404
+              $insert_keys .= ','.$fieldName;
405 405
               $insert_values .= ',?';
406 406
               $bindings[] = $updateArray[$fieldName]; // INFO: do not escape non selected data
407 407
             } else {
408
-              $insert_keys .= ',' . $fieldName;
408
+              $insert_keys .= ','.$fieldName;
409 409
               $insert_values .= ',?';
410 410
               $bindings[] = $value; // INFO: do not escape non selected data
411 411
             }
@@ -416,10 +416,10 @@  discard block
 block discarded – undo
416 416
         $insert_values = ltrim($insert_values, ',');
417 417
 
418 418
         // insert the "copied" row
419
-        $new_query = 'INSERT INTO ' . $databaseName . $dbConnection->quote_string($table) . ' 
420
-          (' . $insert_keys . ')
419
+        $new_query = 'INSERT INTO '.$databaseName.$dbConnection->quote_string($table).' 
420
+          (' . $insert_keys.')
421 421
           VALUES 
422
-          (' . $insert_values . ')
422
+          (' . $insert_values.')
423 423
         ';
424 424
 
425 425
         return $dbConnection->query($new_query, $bindings);
Please login to merge, or discard this patch.
src/voku/db/DB.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -983,7 +983,7 @@
 block discarded – undo
983 983
    * @param string  $query    <p>sql-query</p>
984 984
    * @param bool    $useCache optional <p>use cache?</p>
985 985
    * @param int     $cacheTTL optional <p>cache-ttl in seconds</p>
986
-   * @param DB|null $db       optional <p>the database connection</p>
986
+   * @param null|\self $db       optional <p>the database connection</p>
987 987
    *
988 988
    * @return mixed "array" by "<b>SELECT</b>"-queries<br />
989 989
    *               "int" (insert_id) by "<b>INSERT</b>"-queries<br />
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -418,9 +418,9 @@  discard block
 block discarded – undo
418 418
         }
419 419
 
420 420
         if ($_connector === 'NOT IN' || $_connector === 'IN') {
421
-          $_value = '(' . \implode(',', $_value) . ')';
421
+          $_value = '('.\implode(',', $_value).')';
422 422
         } elseif ($_connector === 'NOT BETWEEN' || $_connector === 'BETWEEN') {
423
-          $_value = '(' . \implode(' AND ', $_value) . ')';
423
+          $_value = '('.\implode(' AND ', $_value).')';
424 424
         }
425 425
 
426 426
       } else {
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
           $valueInner = "''";
468 468
         }
469 469
 
470
-        $sql .= ' ' . $_glueHelperInner . ' ' . $quoteString . ' ' . $_connector . ' ' . $valueInner . " \n";
470
+        $sql .= ' '.$_glueHelperInner.' '.$quoteString.' '.$_connector.' '.$valueInner." \n";
471 471
         $tmpCounter++;
472 472
       }
473 473
 
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 
555 555
       // add ":" if needed
556 556
       if (\strpos($name, ':') !== 0) {
557
-        $nameTmp = ':' . $name;
557
+        $nameTmp = ':'.$name;
558 558
       } else {
559 559
         $nameTmp = $name;
560 560
       }
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
         $this->connected = $this->_doctrine_connection->isConnected();
707 707
 
708 708
         if (!$this->connected) {
709
-          $error = 'Error connecting to mysql server: ' . $this->_doctrine_connection->errorInfo();
709
+          $error = 'Error connecting to mysql server: '.$this->_doctrine_connection->errorInfo();
710 710
           $this->_debug->displayError($error, false);
711 711
           throw new DBConnectException($error, 101);
712 712
         }
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
       );
770 770
 
771 771
     } catch (\Exception $e) {
772
-      $error = 'Error connecting to mysql server: ' . $e->getMessage();
772
+      $error = 'Error connecting to mysql server: '.$e->getMessage();
773 773
       $this->_debug->displayError($error, false);
774 774
       throw new DBConnectException($error, 100, $e);
775 775
     }
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
 
778 778
     $errno = \mysqli_connect_errno();
779 779
     if (!$this->connected || $errno) {
780
-      $error = 'Error connecting to mysql server: ' . \mysqli_connect_error() . ' (' . $errno . ')';
780
+      $error = 'Error connecting to mysql server: '.\mysqli_connect_error().' ('.$errno.')';
781 781
       $this->_debug->displayError($error, false);
782 782
       throw new DBConnectException($error, 101);
783 783
     }
@@ -818,10 +818,10 @@  discard block
 block discarded – undo
818 818
     }
819 819
 
820 820
     if ($databaseName) {
821
-      $databaseName = $this->quote_string(\trim($databaseName)) . '.';
821
+      $databaseName = $this->quote_string(\trim($databaseName)).'.';
822 822
     }
823 823
 
824
-    $sql = 'DELETE FROM ' . $databaseName . $this->quote_string($table) . " WHERE ($WHERE)";
824
+    $sql = 'DELETE FROM '.$databaseName.$this->quote_string($table)." WHERE ($WHERE)";
825 825
 
826 826
     return $this->query($sql);
827 827
   }
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
 
1005 1005
     if ($useCache === true) {
1006 1006
       $cache = new Cache(null, null, false, $useCache);
1007
-      $cacheKey = 'sql-' . \md5($query);
1007
+      $cacheKey = 'sql-'.\md5($query);
1008 1008
 
1009 1009
       if (
1010 1010
           $cache->getCacheIsReady() === true
@@ -1141,7 +1141,7 @@  discard block
 block discarded – undo
1141 1141
     }
1142 1142
 
1143 1143
     if (
1144
-        $hostname . $username . $password . $database . $port . $charset == '3306utf8'
1144
+        $hostname.$username.$password.$database.$port.$charset == '3306utf8'
1145 1145
         &&
1146 1146
         null !== $firstInstance
1147 1147
     ) {
@@ -1159,11 +1159,11 @@  discard block
 block discarded – undo
1159 1159
       } else {
1160 1160
         $extra_config_value_tmp = (string)$extra_config_value;
1161 1161
       }
1162
-      $extra_config_string .= $extra_config_key . $extra_config_value_tmp;
1162
+      $extra_config_string .= $extra_config_key.$extra_config_value_tmp;
1163 1163
     }
1164 1164
 
1165 1165
     $connection = \md5(
1166
-        $hostname . $username . $password . $database . $port . $charset . (int)$exit_on_error . (int)$echo_on_error . $logger_class_name . $logger_level . $extra_config_string
1166
+        $hostname.$username.$password.$database.$port.$charset.(int)$exit_on_error.(int)$echo_on_error.$logger_class_name.$logger_level.$extra_config_string
1167 1167
     );
1168 1168
 
1169 1169
     if (!isset($instance[$connection])) {
@@ -1254,10 +1254,10 @@  discard block
 block discarded – undo
1254 1254
     $SET = $this->_parseArrayPair($data);
1255 1255
 
1256 1256
     if ($databaseName) {
1257
-      $databaseName = $this->quote_string(\trim($databaseName)) . '.';
1257
+      $databaseName = $this->quote_string(\trim($databaseName)).'.';
1258 1258
     }
1259 1259
 
1260
-    $sql = 'INSERT INTO ' . $databaseName . $this->quote_string($table) . " SET $SET";
1260
+    $sql = 'INSERT INTO '.$databaseName.$this->quote_string($table)." SET $SET";
1261 1261
 
1262 1262
     return $this->query($sql);
1263 1263
   }
@@ -1656,11 +1656,11 @@  discard block
 block discarded – undo
1656 1656
 
1657 1657
       // exit if we have more then 3 "DB server has gone away"-errors
1658 1658
       if ($RECONNECT_COUNTER > 3) {
1659
-        $this->_debug->mailToAdmin('DB-Fatal-Error', $errorMessage . '(' . $errorNumber . ') ' . ":\n<br />" . $sql, 5);
1659
+        $this->_debug->mailToAdmin('DB-Fatal-Error', $errorMessage.'('.$errorNumber.') '.":\n<br />".$sql, 5);
1660 1660
         throw new DBGoneAwayException($errorMessage);
1661 1661
       }
1662 1662
 
1663
-      $this->_debug->mailToAdmin('DB-Error', $errorMessage . '(' . $errorNumber . ') ' . ":\n<br />" . $sql);
1663
+      $this->_debug->mailToAdmin('DB-Error', $errorMessage.'('.$errorNumber.') '.":\n<br />".$sql);
1664 1664
 
1665 1665
       // reconnect
1666 1666
       $RECONNECT_COUNTER++;
@@ -1674,7 +1674,7 @@  discard block
 block discarded – undo
1674 1674
       return false;
1675 1675
     }
1676 1676
 
1677
-    $this->_debug->mailToAdmin('SQL-Error', $errorMessage . '(' . $errorNumber . ') ' . ":\n<br />" . $sql);
1677
+    $this->_debug->mailToAdmin('SQL-Error', $errorMessage.'('.$errorNumber.') '.":\n<br />".$sql);
1678 1678
 
1679 1679
     $force_exception_after_error = null; // auto
1680 1680
     if ($this->_in_transaction === true) {
@@ -1682,7 +1682,7 @@  discard block
 block discarded – undo
1682 1682
     }
1683 1683
     // this query returned an error, we must display it (only for dev) !!!
1684 1684
 
1685
-    $this->_debug->displayError($errorMessage . '(' . $errorNumber . ') ' . ' | ' . $sql, $force_exception_after_error);
1685
+    $this->_debug->displayError($errorMessage.'('.$errorNumber.') '.' | '.$sql, $force_exception_after_error);
1686 1686
 
1687 1687
     return false;
1688 1688
   }
@@ -1705,7 +1705,7 @@  discard block
 block discarded – undo
1705 1705
         )
1706 1706
     );
1707 1707
 
1708
-    return '`' . $str . '`';
1708
+    return '`'.$str.'`';
1709 1709
   }
1710 1710
 
1711 1711
   /**
@@ -1775,10 +1775,10 @@  discard block
 block discarded – undo
1775 1775
     $values = \implode(',', $data);
1776 1776
 
1777 1777
     if ($databaseName) {
1778
-      $databaseName = $this->quote_string(\trim($databaseName)) . '.';
1778
+      $databaseName = $this->quote_string(\trim($databaseName)).'.';
1779 1779
     }
1780 1780
 
1781
-    $sql = 'REPLACE INTO ' . $databaseName . $this->quote_string($table) . " ($columns) VALUES ($values)";
1781
+    $sql = 'REPLACE INTO '.$databaseName.$this->quote_string($table)." ($columns) VALUES ($values)";
1782 1782
 
1783 1783
     return $this->query($sql);
1784 1784
   }
@@ -1910,7 +1910,7 @@  discard block
 block discarded – undo
1910 1910
     $var = $this->escape($var, false, false, null);
1911 1911
 
1912 1912
     if (\is_string($var)) {
1913
-      $var = "'" . \trim($var, "'") . "'";
1913
+      $var = "'".\trim($var, "'")."'";
1914 1914
     }
1915 1915
 
1916 1916
     return $var;
@@ -1947,10 +1947,10 @@  discard block
 block discarded – undo
1947 1947
     }
1948 1948
 
1949 1949
     if ($databaseName) {
1950
-      $databaseName = $this->quote_string(\trim($databaseName)) . '.';
1950
+      $databaseName = $this->quote_string(\trim($databaseName)).'.';
1951 1951
     }
1952 1952
 
1953
-    $sql = 'SELECT * FROM ' . $databaseName . $this->quote_string($table) . " WHERE ($WHERE)";
1953
+    $sql = 'SELECT * FROM '.$databaseName.$this->quote_string($table)." WHERE ($WHERE)";
1954 1954
 
1955 1955
     return $this->query($sql);
1956 1956
   }
@@ -2037,9 +2037,9 @@  discard block
 block discarded – undo
2037 2037
 
2038 2038
     $return = mysqli_set_charset($this->link, $charset);
2039 2039
     /** @noinspection PhpUsageOfSilenceOperatorInspection */
2040
-    @\mysqli_query($this->link, 'SET CHARACTER SET ' . $charset);
2040
+    @\mysqli_query($this->link, 'SET CHARACTER SET '.$charset);
2041 2041
     /** @noinspection PhpUsageOfSilenceOperatorInspection */
2042
-    @\mysqli_query($this->link, "SET NAMES '" . $charset . "'");
2042
+    @\mysqli_query($this->link, "SET NAMES '".$charset."'");
2043 2043
 
2044 2044
     return $return;
2045 2045
   }
@@ -2168,7 +2168,7 @@  discard block
 block discarded – undo
2168 2168
    */
2169 2169
   public function table_exists(string $table): bool
2170 2170
   {
2171
-    $check = $this->query('SELECT 1 FROM ' . $this->quote_string($table));
2171
+    $check = $this->query('SELECT 1 FROM '.$this->quote_string($table));
2172 2172
 
2173 2173
     return $check !== false
2174 2174
            &&
@@ -2199,7 +2199,7 @@  discard block
 block discarded – undo
2199 2199
       $result = $callback($this);
2200 2200
       if ($result === false) {
2201 2201
         /** @noinspection ThrowRawExceptionInspection */
2202
-        throw new \Exception('call_user_func [' . $callback . '] === false');
2202
+        throw new \Exception('call_user_func ['.$callback.'] === false');
2203 2203
       }
2204 2204
 
2205 2205
       return $this->commit();
@@ -2252,10 +2252,10 @@  discard block
 block discarded – undo
2252 2252
     }
2253 2253
 
2254 2254
     if ($databaseName) {
2255
-      $databaseName = $this->quote_string(\trim($databaseName)) . '.';
2255
+      $databaseName = $this->quote_string(\trim($databaseName)).'.';
2256 2256
     }
2257 2257
 
2258
-    $sql = 'UPDATE ' . $databaseName . $this->quote_string($table) . " SET $SET WHERE ($WHERE)";
2258
+    $sql = 'UPDATE '.$databaseName.$this->quote_string($table)." SET $SET WHERE ($WHERE)";
2259 2259
 
2260 2260
     return $this->query($sql);
2261 2261
   }
Please login to merge, or discard this patch.
src/voku/db/Prepare.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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') {
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
     // debug_backtrace returns arguments by reference, see comments at http://php.net/manual/de/function.func-get-args.php
149 149
     $trace = \debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 1);
150 150
 
151
-    $args =& $trace[0]['args'];
151
+    $args = & $trace[0]['args'];
152 152
     $typesArray = \str_split($types);
153 153
 
154 154
     $args_count = \count($args) - 1;
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 
163 163
     $arg = 1;
164 164
     foreach ($typesArray as $typeInner) {
165
-      $val =& $args[$arg];
165
+      $val = & $args[$arg];
166 166
       $this->_boundParams[] = [
167 167
           'type'  => $typeInner,
168 168
           'value' => &$val,
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     $bool = parent::prepare($query);
299 299
 
300 300
     if ($bool === false) {
301
-      $this->_debug->displayError('Can not prepare query: ' . $query . ' | ' . $this->error, false);
301
+      $this->_debug->displayError('Can not prepare query: '.$query.' | '.$this->error, false);
302 302
     }
303 303
 
304 304
     return $bool;
@@ -386,11 +386,11 @@  discard block
 block discarded – undo
386 386
 
387 387
       // exit if we have more then 3 "DB server has gone away"-errors
388 388
       if ($RECONNECT_COUNTER > 3) {
389
-        $this->_debug->mailToAdmin('DB-Fatal-Error', $errorMsg . ":\n<br />" . $sql, 5);
389
+        $this->_debug->mailToAdmin('DB-Fatal-Error', $errorMsg.":\n<br />".$sql, 5);
390 390
         throw new DBGoneAwayException($errorMsg);
391 391
       }
392 392
 
393
-      $this->_debug->mailToAdmin('DB-Error', $errorMsg . ":\n<br />" . $sql);
393
+      $this->_debug->mailToAdmin('DB-Error', $errorMsg.":\n<br />".$sql);
394 394
 
395 395
       // reconnect
396 396
       $RECONNECT_COUNTER++;
@@ -400,10 +400,10 @@  discard block
 block discarded – undo
400 400
       return $this->execute();
401 401
     }
402 402
 
403
-    $this->_debug->mailToAdmin('SQL-Error', $errorMsg . ":\n<br />" . $sql);
403
+    $this->_debug->mailToAdmin('SQL-Error', $errorMsg.":\n<br />".$sql);
404 404
 
405 405
     // this query returned an error, we must display it (only for dev) !!!
406
-    $this->_debug->displayError($errorMsg . ' | ' . $sql);
406
+    $this->_debug->displayError($errorMsg.' | '.$sql);
407 407
 
408 408
     return false;
409 409
   }
Please login to merge, or discard this patch.
src/voku/db/Debug.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
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
 
@@ -156,11 +156,11 @@  discard block
 block discarded – undo
156 156
       $box_bg = $this->css_mysql_box_bg;
157 157
 
158 158
       echo '
159
-      <div class="OBJ-mysql-box" style="border:' . $box_border . '; background:' . $box_bg . '; padding:10px; margin:10px;">
159
+      <div class="OBJ-mysql-box" style="border:' . $box_border.'; background:'.$box_bg.'; padding:10px; margin:10px;">
160 160
         <b style="font-size:14px;">MYSQL Error:</b>
161 161
         <code style="display:block;">
162
-          file / line: ' . $fileInfo['file'] . ' / ' . $fileInfo['line'] . '
163
-          ' . $error . '
162
+          file / line: ' . $fileInfo['file'].' / '.$fileInfo['line'].'
163
+          ' . $error.'
164 164
         </code>
165 165
       </div>
166 166
       ';
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
       /** @noinspection PhpUsageOfSilenceOperatorInspection */
302 302
       $infoExtra = @\mysqli_info($tmpLink);
303 303
       if ($infoExtra) {
304
-        $infoExtra = ' | info => ' . $infoExtra;
304
+        $infoExtra = ' | info => '.$infoExtra;
305 305
       }
306 306
     }
307 307
 
@@ -309,14 +309,14 @@  discard block
 block discarded – undo
309 309
     // logging
310 310
     //
311 311
 
312
-    $info = 'time => ' . \round($duration, 5) . ' | results => ' . (int)$results . $infoExtra . ' | SQL => ' . UTF8::htmlentities($sql);
312
+    $info = 'time => '.\round($duration, 5).' | results => '.(int)$results.$infoExtra.' | SQL => '.UTF8::htmlentities($sql);
313 313
 
314 314
     $fileInfo = $this->getFileAndLineFromSql();
315 315
 
316 316
     return $this->logger(
317 317
         [
318 318
             $logLevel,
319
-            '<strong>' . \date('d. m. Y G:i:s') . ' (' . $fileInfo['file'] . ' line: ' . $fileInfo['line'] . '):</strong> ' . $info . '<br>',
319
+            '<strong>'.\date('d. m. Y G:i:s').' ('.$fileInfo['file'].' line: '.$fileInfo['line'].'):</strong> '.$info.'<br>',
320 320
             'sql',
321 321
         ]
322 322
     );
@@ -382,21 +382,21 @@  discard block
 block discarded – undo
382 382
         $this->logger(
383 383
             [
384 384
                 'debug',
385
-                $subject . ' | ' . $htmlBody,
385
+                $subject.' | '.$htmlBody,
386 386
             ]
387 387
         );
388 388
       } elseif ($priority > 3) {
389 389
         $this->logger(
390 390
             [
391 391
                 'error',
392
-                $subject . ' | ' . $htmlBody,
392
+                $subject.' | '.$htmlBody,
393 393
             ]
394 394
         );
395 395
       } elseif ($priority < 3) {
396 396
         $this->logger(
397 397
             [
398 398
                 'info',
399
-                $subject . ' | ' . $htmlBody,
399
+                $subject.' | '.$htmlBody,
400 400
             ]
401 401
         );
402 402
       }
Please login to merge, or discard this patch.