Passed
Push — master ( c75785...9e3dbf )
by Jan
05:03
created
src/Debugger.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         $output     = '';
102 102
         $traceIndex = ($options['reverse'] ? 1 : count($backtrace));
103 103
         foreach ($backtrace as $trace) {
104
-            $output .= $traceIndex . ': ';
104
+            $output .= $traceIndex.': ';
105 105
             $output .= self::getCalledFromTrace($trace);
106 106
             $output .= "\n";
107 107
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             $data .= "\n";
130 130
         }
131 131
 
132
-        $data         .= 'class ' . $reflectionClass->name . '{';
132
+        $data .= 'class '.$reflectionClass->name.'{';
133 133
         $firstElement = true;
134 134
         foreach ($reflectionClass->getProperties() as $reflectionProperty) {
135 135
             if (!$firstElement) {
@@ -186,9 +186,9 @@  discard block
 block discarded – undo
186 186
         $data .= ($reflectionProperty->isPrivate() ? 'private ' : '');
187 187
         $data .= ($reflectionProperty->isProtected() ? 'protected ' : '');
188 188
         $data .= ($reflectionProperty->isStatic() ? 'static ' : '');
189
-        $data .= '$' . $reflectionProperty->name;
189
+        $data .= '$'.$reflectionProperty->name;
190 190
         if (isset($defaultPropertyValues[$property])) {
191
-            $data .= ' = ' . self::getDebugInformation($defaultPropertyValues[$property]);
191
+            $data .= ' = '.self::getDebugInformation($defaultPropertyValues[$property]);
192 192
         }
193 193
         $data .= ';';
194 194
 
@@ -225,15 +225,15 @@  discard block
 block discarded – undo
225 225
         $data .= ($reflectionMethod->isPrivate() ? 'private ' : '');
226 226
         $data .= ($reflectionMethod->isProtected() ? 'protected ' : '');
227 227
         $data .= ($reflectionMethod->isStatic() ? 'static ' : '');
228
-        $data .= 'function ' . $reflectionMethod->name . '(';
228
+        $data .= 'function '.$reflectionMethod->name.'(';
229 229
         if ($reflectionMethod->getNumberOfParameters()) {
230 230
             foreach ($reflectionMethod->getParameters() as $reflectionMethodParameterIndex => $reflectionMethodParameter) {
231 231
                 $data .= ($reflectionMethodParameterIndex > 0 ? ', ' : '');
232
-                $data .= '$' . $reflectionMethodParameter->name;
232
+                $data .= '$'.$reflectionMethodParameter->name;
233 233
                 if ($reflectionMethodParameter->isDefaultValueAvailable()) {
234 234
                     $defaultValue = self::getDebugInformation($reflectionMethodParameter->getDefaultValue());
235 235
                     $defaultValue = str_replace(["\n", "\t"], '', $defaultValue);
236
-                    $data         .= ' = ' . $defaultValue;
236
+                    $data .= ' = '.$defaultValue;
237 237
                 }
238 238
             }
239 239
         }
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
         $backtrace = debug_backtrace();
257 257
 
258 258
         if (!isset($backtrace[$index])) {
259
-            return 'Unknown trace with index: ' . $index;
259
+            return 'Unknown trace with index: '.$index;
260 260
         }
261 261
 
262 262
         return self::getCalledFromTrace($backtrace[$index]);
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
         // Get file and line number
273 273
         $calledFromFile = '';
274 274
         if (isset($trace['file'])) {
275
-            $calledFromFile .= $trace['file'] . ' line ' . $trace['line'];
275
+            $calledFromFile .= $trace['file'].' line '.$trace['line'];
276 276
             $calledFromFile = str_replace('\\', '/', $calledFromFile);
277 277
             $calledFromFile = (!empty(self::$documentRoot) ? substr($calledFromFile, strlen(self::$documentRoot)) : $calledFromFile);
278 278
             $calledFromFile = trim($calledFromFile, '/');
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
         if (isset($trace['function'])) {
284 284
             $calledFromFunction .= (isset($trace['class']) ? $trace['class'] : '');
285 285
             $calledFromFunction .= (isset($trace['type']) ? $trace['type'] : '');
286
-            $calledFromFunction .= $trace['function'] . '()';
286
+            $calledFromFunction .= $trace['function'].'()';
287 287
         }
288 288
 
289 289
         // Return called from
@@ -313,20 +313,20 @@  discard block
 block discarded – undo
313 313
         $dataType = gettype($data);
314 314
 
315 315
         // Set name of method to get debug information for data
316
-        $methodName = 'getDebugInformation' . ucfirst(strtolower($dataType));
316
+        $methodName = 'getDebugInformation'.ucfirst(strtolower($dataType));
317 317
 
318 318
         // Get result from debug information method
319
-        $result = 'No method found supporting data type: ' . $dataType;
319
+        $result = 'No method found supporting data type: '.$dataType;
320 320
         if (method_exists('\Xicrow\PhpDebug\Debugger', $methodName)) {
321
-            $result = (string)self::$methodName($data, [
321
+            $result = (string) self::$methodName($data, [
322 322
                 'depth'  => ($options['depth'] - 1),
323 323
                 'indent' => ($options['indent'] + 1),
324 324
             ]);
325 325
         }
326 326
 
327 327
         // Format the result
328
-        if (php_sapi_name() != 'cli' && !empty(self::$style['debug_' . strtolower($dataType) . '_format'])) {
329
-            $result = sprintf(self::$style['debug_' . strtolower($dataType) . '_format'], $result);
328
+        if (php_sapi_name() != 'cli' && !empty(self::$style['debug_'.strtolower($dataType).'_format'])) {
329
+            $result = sprintf(self::$style['debug_'.strtolower($dataType).'_format'], $result);
330 330
         }
331 331
 
332 332
         // Return result
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
      */
339 339
     private static function getDebugInformationString($data)
340 340
     {
341
-        return (string)(php_sapi_name() == 'cli' ? '"' . $data . '"' : htmlentities($data, ENT_SUBSTITUTE));
341
+        return (string) (php_sapi_name() == 'cli' ? '"'.$data.'"' : htmlentities($data, ENT_SUBSTITUTE));
342 342
     }
343 343
 
344 344
     /**
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
      */
367 367
     private static function getDebugInformationInteger($data)
368 368
     {
369
-        return (string)$data;
369
+        return (string) $data;
370 370
     }
371 371
 
372 372
     /**
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
      */
377 377
     private static function getDebugInformationDouble($data)
378 378
     {
379
-        return (string)$data;
379
+        return (string) $data;
380 380
     }
381 381
 
382 382
     /**
@@ -395,8 +395,8 @@  discard block
 block discarded – undo
395 395
 
396 396
         $break = $end = null;
397 397
         if (!empty($data)) {
398
-            $break = "\n" . str_repeat("\t", $options['indent']);
399
-            $end   = "\n" . str_repeat("\t", $options['indent'] - 1);
398
+            $break = "\n".str_repeat("\t", $options['indent']);
399
+            $end   = "\n".str_repeat("\t", $options['indent'] - 1);
400 400
         }
401 401
 
402 402
         $datas = [];
@@ -408,13 +408,13 @@  discard block
 block discarded – undo
408 408
                 } elseif ($val !== $data) {
409 409
                     $val = static::getDebugInformation($val, $options);
410 410
                 }
411
-                $datas[] = $break . static::getDebugInformation($key) . ' => ' . $val;
411
+                $datas[] = $break.static::getDebugInformation($key).' => '.$val;
412 412
             }
413 413
         } else {
414
-            $datas[] = $break . '[maximum depth reached]';
414
+            $datas[] = $break.'[maximum depth reached]';
415 415
         }
416 416
 
417
-        return $debugInfo . implode(',', $datas) . $end . ']';
417
+        return $debugInfo.implode(',', $datas).$end.']';
418 418
     }
419 419
 
420 420
     /**
@@ -430,23 +430,23 @@  discard block
 block discarded – undo
430 430
         ], $options);
431 431
 
432 432
         $debugInfo = '';
433
-        $debugInfo .= 'object(' . get_class($data) . ') {';
433
+        $debugInfo .= 'object('.get_class($data).') {';
434 434
 
435
-        $break = "\n" . str_repeat("\t", $options['indent']);
436
-        $end   = "\n" . str_repeat("\t", $options['indent'] - 1);
435
+        $break = "\n".str_repeat("\t", $options['indent']);
436
+        $end   = "\n".str_repeat("\t", $options['indent'] - 1);
437 437
 
438 438
         if ($options['depth'] > 0 && method_exists($data, '__debugInfo')) {
439 439
             try {
440 440
                 $debugArray = static::getDebugInformationArray($data->__debugInfo(), array_merge($options, [
441 441
                     'depth' => ($options['depth'] - 1),
442 442
                 ]));
443
-                $debugInfo  .= substr($debugArray, 1, -1);
443
+                $debugInfo .= substr($debugArray, 1, -1);
444 444
 
445
-                return $debugInfo . $end . '}';
445
+                return $debugInfo.$end.'}';
446 446
             } catch (\Exception $e) {
447 447
                 $message = $e->getMessage();
448 448
 
449
-                return $debugInfo . "\n(unable to export object: $message)\n }";
449
+                return $debugInfo."\n(unable to export object: $message)\n }";
450 450
             }
451 451
         }
452 452
 
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
                 $value   = static::getDebugInformation($value, array_merge($options, [
458 458
                     'depth' => ($options['depth'] - 1),
459 459
                 ]));
460
-                $props[] = "$key => " . $value;
460
+                $props[] = "$key => ".$value;
461 461
             }
462 462
 
463 463
             $ref     = new \ReflectionObject($data);
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
                 }
480 480
             }
481 481
 
482
-            $debugInfo .= $break . implode($break, $props) . $end;
482
+            $debugInfo .= $break.implode($break, $props).$end;
483 483
         }
484 484
         $debugInfo .= '}';
485 485
 
@@ -493,6 +493,6 @@  discard block
 block discarded – undo
493 493
      */
494 494
     private static function getDebugInformationResource($data)
495 495
     {
496
-        return (string)$data . ' (' . get_resource_type($data) . ')';
496
+        return (string) $data.' ('.get_resource_type($data).')';
497 497
     }
498 498
 }
Please login to merge, or discard this patch.