Completed
Push — master ( 72fec8...ace86f )
by Lars
04:31
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
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
     $value = $this->_filterParam($this->dirty);
584 584
     $this->insert = new ActiveRecordExpressions(
585 585
         [
586
-            'operator' => 'INSERT INTO ' . $this->table,
586
+            'operator' => 'INSERT INTO '.$this->table,
587 587
             'target'   => new ActiveRecordExpressionsWrap(['target' => \array_keys($this->dirty)]),
588 588
         ]
589 589
     );
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
         null === $active_record->{$sql_string_part}
795 795
     ) {
796 796
 
797
-      $sql_string_part = \strtoupper($sql_string_part) . ' ' . $active_record->table . '.*';
797
+      $sql_string_part = \strtoupper($sql_string_part).' '.$active_record->table.'.*';
798 798
 
799 799
     } elseif (
800 800
         (
@@ -806,15 +806,15 @@  discard block
 block discarded – undo
806 806
         null === $active_record->{$sql_string_part}
807 807
     ) {
808 808
 
809
-      $sql_string_part = \strtoupper($sql_string_part) . ' ' . $active_record->table;
809
+      $sql_string_part = \strtoupper($sql_string_part).' '.$active_record->table;
810 810
 
811 811
     } elseif ('delete' === $sql_string_part) {
812 812
 
813
-      $sql_string_part = \strtoupper($sql_string_part) . ' ';
813
+      $sql_string_part = \strtoupper($sql_string_part).' ';
814 814
 
815 815
     } else {
816 816
 
817
-      $sql_string_part = (null !== $active_record->{$sql_string_part}) ? $active_record->{$sql_string_part} . ' ' : '';
817
+      $sql_string_part = (null !== $active_record->{$sql_string_part}) ? $active_record->{$sql_string_part}.' ' : '';
818 818
 
819 819
     }
820 820
   }
@@ -928,10 +928,10 @@  discard block
 block discarded – undo
928 928
   {
929 929
     if (\is_array($value)) {
930 930
       foreach ($value as $key => $val) {
931
-        $this->params[$value[$key] = self::PREFIX . ++self::$count] = $val;
931
+        $this->params[$value[$key] = self::PREFIX.++self::$count] = $val;
932 932
       }
933 933
     } elseif (\is_string($value)) {
934
-      $this->params[$ph = self::PREFIX . ++self::$count] = $value;
934
+      $this->params[$ph = self::PREFIX.++self::$count] = $value;
935 935
       $value = $ph;
936 936
     }
937 937
 
@@ -952,7 +952,7 @@  discard block
 block discarded – undo
952 952
     $value = $this->_filterParam($value);
953 953
     $expression = new ActiveRecordExpressions(
954 954
         [
955
-            'source'   => ('where' === strtolower($name) ? $this->table . '.' : '') . $field,
955
+            'source'   => ('where' === strtolower($name) ? $this->table.'.' : '').$field,
956 956
             'operator' => $operator,
957 957
             'target'   => \is_array($value)
958 958
                 ? new ActiveRecordExpressionsWrap(
@@ -986,7 +986,7 @@  discard block
 block discarded – undo
986 986
     $this->join = new ActiveRecordExpressions(
987 987
         [
988 988
             'source'   => $this->join ?: '',
989
-            'operator' => $type . ' JOIN',
989
+            'operator' => $type.' JOIN',
990 990
             'target'   => new ActiveRecordExpressions(
991 991
                 ['source' => $table, 'operator' => 'ON', 'target' => $on]
992 992
             ),
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/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') {
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
   }
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
@@ -427,9 +427,9 @@  discard block
 block discarded – undo
427 427
         }
428 428
 
429 429
         if ($_connector === 'NOT IN' || $_connector === 'IN') {
430
-          $_value = '(' . \implode(',', $_value) . ')';
430
+          $_value = '('.\implode(',', $_value).')';
431 431
         } elseif ($_connector === 'NOT BETWEEN' || $_connector === 'BETWEEN') {
432
-          $_value = '(' . \implode(' AND ', $_value) . ')';
432
+          $_value = '('.\implode(' AND ', $_value).')';
433 433
         }
434 434
 
435 435
       } else {
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
           $valueInner = "''";
477 477
         }
478 478
 
479
-        $sql .= ' ' . $_glueHelperInner . ' ' . $quoteString . ' ' . $_connector . ' ' . $valueInner . " \n";
479
+        $sql .= ' '.$_glueHelperInner.' '.$quoteString.' '.$_connector.' '.$valueInner." \n";
480 480
         $tmpCounter++;
481 481
       }
482 482
 
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 
564 564
       // add ":" if needed
565 565
       if (\strpos($name, ':') !== 0) {
566
-        $nameTmp = ':' . $name;
566
+        $nameTmp = ':'.$name;
567 567
       } else {
568 568
         $nameTmp = $name;
569 569
       }
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
           $this->connected = $this->_doctrine_connection->isConnected();
709 709
 
710 710
           if (!$this->connected) {
711
-            $error = 'Error connecting to mysql server: ' . $this->_doctrine_connection->errorInfo();
711
+            $error = 'Error connecting to mysql server: '.$this->_doctrine_connection->errorInfo();
712 712
             $this->_debug->displayError($error, false);
713 713
             throw new DBConnectException($error, 101);
714 714
           }
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
       );
773 773
 
774 774
     } catch (\Exception $e) {
775
-      $error = 'Error connecting to mysql server: ' . $e->getMessage();
775
+      $error = 'Error connecting to mysql server: '.$e->getMessage();
776 776
       $this->_debug->displayError($error, false);
777 777
       throw new DBConnectException($error, 100, $e);
778 778
     }
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
 
781 781
     $errno = \mysqli_connect_errno();
782 782
     if (!$this->connected || $errno) {
783
-      $error = 'Error connecting to mysql server: ' . \mysqli_connect_error() . ' (' . $errno . ')';
783
+      $error = 'Error connecting to mysql server: '.\mysqli_connect_error().' ('.$errno.')';
784 784
       $this->_debug->displayError($error, false);
785 785
       throw new DBConnectException($error, 101);
786 786
     }
@@ -821,10 +821,10 @@  discard block
 block discarded – undo
821 821
     }
822 822
 
823 823
     if ($databaseName) {
824
-      $databaseName = $this->quote_string(\trim($databaseName)) . '.';
824
+      $databaseName = $this->quote_string(\trim($databaseName)).'.';
825 825
     }
826 826
 
827
-    $sql = 'DELETE FROM ' . $databaseName . $this->quote_string($table) . " WHERE ($WHERE)";
827
+    $sql = 'DELETE FROM '.$databaseName.$this->quote_string($table)." WHERE ($WHERE)";
828 828
 
829 829
     return $this->query($sql);
830 830
   }
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
 
1008 1008
     if ($useCache === true) {
1009 1009
       $cache = new Cache(null, null, false, $useCache);
1010
-      $cacheKey = 'sql-' . \md5($query);
1010
+      $cacheKey = 'sql-'.\md5($query);
1011 1011
 
1012 1012
       if (
1013 1013
           $cache->getCacheIsReady() === true
@@ -1144,7 +1144,7 @@  discard block
 block discarded – undo
1144 1144
     }
1145 1145
 
1146 1146
     if (
1147
-        $hostname . $username . $password . $database . $port . $charset == '3306utf8'
1147
+        $hostname.$username.$password.$database.$port.$charset == '3306utf8'
1148 1148
         &&
1149 1149
         null !== $firstInstance
1150 1150
     ) {
@@ -1163,7 +1163,7 @@  discard block
 block discarded – undo
1163 1163
         } else {
1164 1164
           $extra_config_value_tmp = (string)$extra_config_value;
1165 1165
         }
1166
-        $extra_config_string .= $extra_config_key . $extra_config_value_tmp;
1166
+        $extra_config_string .= $extra_config_key.$extra_config_value_tmp;
1167 1167
       }
1168 1168
     } else {
1169 1169
       // only for backward compatibility
@@ -1171,7 +1171,7 @@  discard block
 block discarded – undo
1171 1171
     }
1172 1172
 
1173 1173
     $connection = \md5(
1174
-        $hostname . $username . $password . $database . $port . $charset . (int)$exit_on_error . (int)$echo_on_error . $logger_class_name . $logger_level . $extra_config_string
1174
+        $hostname.$username.$password.$database.$port.$charset.(int)$exit_on_error.(int)$echo_on_error.$logger_class_name.$logger_level.$extra_config_string
1175 1175
     );
1176 1176
 
1177 1177
     if (!isset($instance[$connection])) {
@@ -1262,10 +1262,10 @@  discard block
 block discarded – undo
1262 1262
     $SET = $this->_parseArrayPair($data);
1263 1263
 
1264 1264
     if ($databaseName) {
1265
-      $databaseName = $this->quote_string(\trim($databaseName)) . '.';
1265
+      $databaseName = $this->quote_string(\trim($databaseName)).'.';
1266 1266
     }
1267 1267
 
1268
-    $sql = 'INSERT INTO ' . $databaseName . $this->quote_string($table) . " SET $SET";
1268
+    $sql = 'INSERT INTO '.$databaseName.$this->quote_string($table)." SET $SET";
1269 1269
 
1270 1270
     return $this->query($sql);
1271 1271
   }
@@ -1659,11 +1659,11 @@  discard block
 block discarded – undo
1659 1659
 
1660 1660
       // exit if we have more then 3 "DB server has gone away"-errors
1661 1661
       if ($RECONNECT_COUNTER > 3) {
1662
-        $this->_debug->mailToAdmin('DB-Fatal-Error', $errorMessage . '(' . $errorNumber . ') ' . ":\n<br />" . $sql, 5);
1662
+        $this->_debug->mailToAdmin('DB-Fatal-Error', $errorMessage.'('.$errorNumber.') '.":\n<br />".$sql, 5);
1663 1663
         throw new DBGoneAwayException($errorMessage);
1664 1664
       }
1665 1665
 
1666
-      $this->_debug->mailToAdmin('DB-Error', $errorMessage . '(' . $errorNumber . ') ' . ":\n<br />" . $sql);
1666
+      $this->_debug->mailToAdmin('DB-Error', $errorMessage.'('.$errorNumber.') '.":\n<br />".$sql);
1667 1667
 
1668 1668
       // reconnect
1669 1669
       $RECONNECT_COUNTER++;
@@ -1677,7 +1677,7 @@  discard block
 block discarded – undo
1677 1677
       return false;
1678 1678
     }
1679 1679
 
1680
-    $this->_debug->mailToAdmin('SQL-Error', $errorMessage . '(' . $errorNumber . ') ' . ":\n<br />" . $sql);
1680
+    $this->_debug->mailToAdmin('SQL-Error', $errorMessage.'('.$errorNumber.') '.":\n<br />".$sql);
1681 1681
 
1682 1682
     $force_exception_after_error = null; // auto
1683 1683
     if ($this->_in_transaction === true) {
@@ -1685,7 +1685,7 @@  discard block
 block discarded – undo
1685 1685
     }
1686 1686
     // this query returned an error, we must display it (only for dev) !!!
1687 1687
 
1688
-    $this->_debug->displayError($errorMessage . '(' . $errorNumber . ') ' . ' | ' . $sql, $force_exception_after_error);
1688
+    $this->_debug->displayError($errorMessage.'('.$errorNumber.') '.' | '.$sql, $force_exception_after_error);
1689 1689
 
1690 1690
     return false;
1691 1691
   }
@@ -1708,7 +1708,7 @@  discard block
 block discarded – undo
1708 1708
         )
1709 1709
     );
1710 1710
 
1711
-    return '`' . $str . '`';
1711
+    return '`'.$str.'`';
1712 1712
   }
1713 1713
 
1714 1714
   /**
@@ -1778,10 +1778,10 @@  discard block
 block discarded – undo
1778 1778
     $values = \implode(',', $data);
1779 1779
 
1780 1780
     if ($databaseName) {
1781
-      $databaseName = $this->quote_string(\trim($databaseName)) . '.';
1781
+      $databaseName = $this->quote_string(\trim($databaseName)).'.';
1782 1782
     }
1783 1783
 
1784
-    $sql = 'REPLACE INTO ' . $databaseName . $this->quote_string($table) . " ($columns) VALUES ($values)";
1784
+    $sql = 'REPLACE INTO '.$databaseName.$this->quote_string($table)." ($columns) VALUES ($values)";
1785 1785
 
1786 1786
     return $this->query($sql);
1787 1787
   }
@@ -1876,7 +1876,7 @@  discard block
 block discarded – undo
1876 1876
     $var = $this->escape($var, false, false, null);
1877 1877
 
1878 1878
     if (\is_string($var)) {
1879
-      $var = "'" . \trim($var, "'") . "'";
1879
+      $var = "'".\trim($var, "'")."'";
1880 1880
     }
1881 1881
 
1882 1882
     return $var;
@@ -1913,10 +1913,10 @@  discard block
 block discarded – undo
1913 1913
     }
1914 1914
 
1915 1915
     if ($databaseName) {
1916
-      $databaseName = $this->quote_string(\trim($databaseName)) . '.';
1916
+      $databaseName = $this->quote_string(\trim($databaseName)).'.';
1917 1917
     }
1918 1918
 
1919
-    $sql = 'SELECT * FROM ' . $databaseName . $this->quote_string($table) . " WHERE ($WHERE)";
1919
+    $sql = 'SELECT * FROM '.$databaseName.$this->quote_string($table)." WHERE ($WHERE)";
1920 1920
 
1921 1921
     return $this->query($sql);
1922 1922
   }
@@ -2003,9 +2003,9 @@  discard block
 block discarded – undo
2003 2003
 
2004 2004
     $return = mysqli_set_charset($this->link, $charset);
2005 2005
     /** @noinspection PhpUsageOfSilenceOperatorInspection */
2006
-    @\mysqli_query($this->link, 'SET CHARACTER SET ' . $charset);
2006
+    @\mysqli_query($this->link, 'SET CHARACTER SET '.$charset);
2007 2007
     /** @noinspection PhpUsageOfSilenceOperatorInspection */
2008
-    @\mysqli_query($this->link, "SET NAMES '" . $charset . "'");
2008
+    @\mysqli_query($this->link, "SET NAMES '".$charset."'");
2009 2009
 
2010 2010
     return $return;
2011 2011
   }
@@ -2134,7 +2134,7 @@  discard block
 block discarded – undo
2134 2134
    */
2135 2135
   public function table_exists(string $table): bool
2136 2136
   {
2137
-    $check = $this->query('SELECT 1 FROM ' . $this->quote_string($table));
2137
+    $check = $this->query('SELECT 1 FROM '.$this->quote_string($table));
2138 2138
 
2139 2139
     return $check !== false
2140 2140
            &&
@@ -2165,7 +2165,7 @@  discard block
 block discarded – undo
2165 2165
       $result = $callback($this);
2166 2166
       if ($result === false) {
2167 2167
         /** @noinspection ThrowRawExceptionInspection */
2168
-        throw new \Exception('call_user_func [' . $callback . '] === false');
2168
+        throw new \Exception('call_user_func ['.$callback.'] === false');
2169 2169
       }
2170 2170
 
2171 2171
       return $this->commit();
@@ -2218,10 +2218,10 @@  discard block
 block discarded – undo
2218 2218
     }
2219 2219
 
2220 2220
     if ($databaseName) {
2221
-      $databaseName = $this->quote_string(\trim($databaseName)) . '.';
2221
+      $databaseName = $this->quote_string(\trim($databaseName)).'.';
2222 2222
     }
2223 2223
 
2224
-    $sql = 'UPDATE ' . $databaseName . $this->quote_string($table) . " SET $SET WHERE ($WHERE)";
2224
+    $sql = 'UPDATE '.$databaseName.$this->quote_string($table)." SET $SET WHERE ($WHERE)";
2225 2225
 
2226 2226
     return $this->query($sql);
2227 2227
   }
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
 
@@ -153,11 +153,11 @@  discard block
 block discarded – undo
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
         ';
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
       /** @noinspection PhpUsageOfSilenceOperatorInspection */
300 300
       $infoExtra = @\mysqli_info($tmpLink);
301 301
       if ($infoExtra) {
302
-        $infoExtra = ' | info => ' . $infoExtra;
302
+        $infoExtra = ' | info => '.$infoExtra;
303 303
       }
304 304
     }
305 305
 
@@ -307,14 +307,14 @@  discard block
 block discarded – undo
307 307
     // logging
308 308
     //
309 309
 
310
-    $info = 'time => ' . \round($duration, 5) . ' | results => ' . (int)$results . $infoExtra . ' | SQL => ' . UTF8::htmlentities($sql);
310
+    $info = 'time => '.\round($duration, 5).' | results => '.(int)$results.$infoExtra.' | SQL => '.UTF8::htmlentities($sql);
311 311
 
312 312
     $fileInfo = $this->getFileAndLineFromSql();
313 313
 
314 314
     return $this->logger(
315 315
         [
316 316
             $logLevel,
317
-            '<strong>' . \date('d. m. Y G:i:s') . ' (' . $fileInfo['file'] . ' line: ' . $fileInfo['line'] . '):</strong> ' . $info . '<br>',
317
+            '<strong>'.\date('d. m. Y G:i:s').' ('.$fileInfo['file'].' line: '.$fileInfo['line'].'):</strong> '.$info.'<br>',
318 318
             'sql',
319 319
         ]
320 320
     );
@@ -380,21 +380,21 @@  discard block
 block discarded – undo
380 380
         $this->logger(
381 381
             [
382 382
                 'debug',
383
-                $subject . ' | ' . $htmlBody,
383
+                $subject.' | '.$htmlBody,
384 384
             ]
385 385
         );
386 386
       } elseif ($priority > 3) {
387 387
         $this->logger(
388 388
             [
389 389
                 'error',
390
-                $subject . ' | ' . $htmlBody,
390
+                $subject.' | '.$htmlBody,
391 391
             ]
392 392
         );
393 393
       } elseif ($priority < 3) {
394 394
         $this->logger(
395 395
             [
396 396
                 'info',
397
-                $subject . ' | ' . $htmlBody,
397
+                $subject.' | '.$htmlBody,
398 398
             ]
399 399
         );
400 400
       }
Please login to merge, or discard this patch.