Completed
Push — master ( ace86f...569799 )
by Lars
02:21
created
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.
src/voku/db/ActiveRecord.php 1 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.