Completed
Push — master ( d9f018...e19cbd )
by Lars
02:16
created
src/voku/db/Debug.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         } else {
114 114
 
115 115
             // for testing with dev-address
116
-            $noDev = isset($_GET['noDev']) ? (int) $_GET['noDev'] : 0;
116
+            $noDev = isset($_GET['noDev']) ? (int)$_GET['noDev'] : 0;
117 117
             $remoteIpAddress = $_SERVER['REMOTE_ADDR'] ?? false;
118 118
 
119 119
             if (
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
     {
162 162
         $fileInfo = $this->getFileAndLineFromSql();
163 163
 
164
-        $log = '[' . \date('Y-m-d H:i:s') . ']: SQL-Error: ' . $error . ' | Trace: ' . $fileInfo['path'] . '<br>';
164
+        $log = '['.\date('Y-m-d H:i:s').']: SQL-Error: '.$error.' | Trace: '.$fileInfo['path'].'<br>';
165 165
 
166 166
         $this->logger(['error', $log]);
167 167
 
@@ -177,17 +177,17 @@  discard block
 block discarded – undo
177 177
 
178 178
             if (\PHP_SAPI === 'cli') {
179 179
                 echo "\n";
180
-                echo 'Error: ' . $error . "\n";
181
-                echo 'Trace: ' . $fileInfo['path'] . "\n";
180
+                echo 'Error: '.$error."\n";
181
+                echo 'Trace: '.$fileInfo['path']."\n";
182 182
                 echo "\n";
183 183
             } else {
184 184
                 echo '
185
-                <div class="OBJ-mysql-box" style="border: ' . $box_border . '; background: ' . $box_bg . '; padding: 10px; margin: 10px;">
185
+                <div class="OBJ-mysql-box" style="border: ' . $box_border.'; background: '.$box_bg.'; padding: 10px; margin: 10px;">
186 186
                   <b style="font-size: 14px;">MYSQL Error:</b>
187 187
                   <code style="display: block;">
188
-                    Error:' . $error . '
188
+                    Error:' . $error.'
189 189
                     <br><br>
190
-                    Trace: ' . $fileInfo['path'] . '
190
+                    Trace: ' . $fileInfo['path'].'
191 191
                   </code>
192 192
                 </div>
193 193
                 ';
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
                 continue;
243 243
             }
244 244
 
245
-            $path .= ($referrer[$key]['class'] ?? $referrer[$key]['file'] ?? '') . '::' . ($referrer[$key]['function'] ?? '') . ':' . ($referrer[$key - 1]['line'] ?? '') . ' <- ';
245
+            $path .= ($referrer[$key]['class'] ?? $referrer[$key]['file'] ?? '').'::'.($referrer[$key]['function'] ?? '').':'.($referrer[$key - 1]['line'] ?? '').' <- ';
246 246
         }
247 247
 
248 248
         $return['path'] = $path;
@@ -322,11 +322,11 @@  discard block
 block discarded – undo
322 322
                 /** @noinspection PhpUsageOfSilenceOperatorInspection */
323 323
                 $traceStringExtra = @\mysqli_info($tmpLink);
324 324
                 if ($traceStringExtra) {
325
-                    $traceStringExtra = ' | info => ' . $traceStringExtra;
325
+                    $traceStringExtra = ' | info => '.$traceStringExtra;
326 326
                 }
327 327
             }
328 328
 
329
-            $traceStringExtra = ' | results => ' . \print_r($results, true) . $traceStringExtra;
329
+            $traceStringExtra = ' | results => '.\print_r($results, true).$traceStringExtra;
330 330
         }
331 331
 
332 332
         static $SLOW_QUERY_WARNING = null;
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
             $queryStatus = ' ERROR (REPEAT) ';
355 355
         }
356 356
 
357
-        $queryLog = '[' . \date('Y-m-d H:i:s') . ']: ' . $queryStatus . ' Duration: SQL::::DURATION-START' . \round($duration, 5) . 'SQL::::DURATION-END | Repeat: ' . $QUERY_LOG_FILE_INFO[$cacheKey] . ' | Host: ' . $this->_db->getConfig()['hostname'] . ' | Trace: ' . $fileInfo['path'] . ' | SQL: SQL::::QUERY-START ' . \str_replace("\n", '', $sql) . ' SQL::::QUERY-END' . $traceStringExtra . "\n";
357
+        $queryLog = '['.\date('Y-m-d H:i:s').']: '.$queryStatus.' Duration: SQL::::DURATION-START'.\round($duration, 5).'SQL::::DURATION-END | Repeat: '.$QUERY_LOG_FILE_INFO[$cacheKey].' | Host: '.$this->_db->getConfig()['hostname'].' | Trace: '.$fileInfo['path'].' | SQL: SQL::::QUERY-START '.\str_replace("\n", '', $sql).' SQL::::QUERY-END'.$traceStringExtra."\n";
358 358
 
359 359
         return $this->logger([$logLevel, $queryLog, 'sql']);
360 360
     }
@@ -425,11 +425,11 @@  discard block
 block discarded – undo
425 425
             mailToAdmin($subject, $htmlBody, $priority);
426 426
         } else {
427 427
             if ($priority === 3) {
428
-                $this->logger(['debug', $subject . ' | ' . $htmlBody]);
428
+                $this->logger(['debug', $subject.' | '.$htmlBody]);
429 429
             } elseif ($priority > 3) {
430
-                $this->logger(['error', $subject . ' | ' . $htmlBody]);
430
+                $this->logger(['error', $subject.' | '.$htmlBody]);
431 431
             } elseif ($priority < 3) {
432
-                $this->logger(['info', $subject . ' | ' . $htmlBody]);
432
+                $this->logger(['info', $subject.' | '.$htmlBody]);
433 433
             }
434 434
         }
435 435
     }
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
      */
440 440
     public function setEchoOnError($echo_on_error)
441 441
     {
442
-        $this->echo_on_error = (bool) $echo_on_error;
442
+        $this->echo_on_error = (bool)$echo_on_error;
443 443
     }
444 444
 
445 445
     /**
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
      */
448 448
     public function setExitOnError($exit_on_error)
449 449
     {
450
-        $this->exit_on_error = (bool) $exit_on_error;
450
+        $this->exit_on_error = (bool)$exit_on_error;
451 451
     }
452 452
 
453 453
     /**
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
      */
456 456
     public function setLoggerClassName($logger_class_name)
457 457
     {
458
-        $this->logger_class_name = (string) $logger_class_name;
458
+        $this->logger_class_name = (string)$logger_class_name;
459 459
     }
460 460
 
461 461
     /**
@@ -463,6 +463,6 @@  discard block
 block discarded – undo
463 463
      */
464 464
     public function setLoggerLevel($logger_level)
465 465
     {
466
-        $this->logger_level = (string) $logger_level;
466
+        $this->logger_level = (string)$logger_level;
467 467
     }
468 468
 }
Please login to merge, or discard this patch.