Passed
Pull Request — master (#853)
by butschster
07:53
created
src/Exceptions/src/Renderer/PlainRenderer.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     ): string {
23 23
         $verbosity ??= $this->defaultVerbosity;
24 24
         $exceptions = [$exception];
25
-        while ($exception = $exception->getPrevious()) {
25
+        while ($exception = $exception->getPrevious()){
26 26
             $exceptions[] = $exception;
27 27
         }
28 28
 
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
         $result = [];
32 32
 
33
-        foreach ($exceptions as $exception) {
33
+        foreach ($exceptions as $exception){
34 34
             $row = \sprintf(
35 35
                 "[%s]\n%s in %s:%s\n",
36 36
                 $exception::class,
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
                 $exception->getLine()
40 40
             );
41 41
 
42
-            if ($verbosity->value >= Verbosity::DEBUG->value) {
42
+            if ($verbosity->value >= Verbosity::DEBUG->value){
43 43
                 $row .= $this->renderTrace($exception, new Highlighter(new PlainStyle()));
44
-            } elseif ($verbosity->value >= Verbosity::VERBOSE->value) {
44
+            } elseif ($verbosity->value >= Verbosity::VERBOSE->value){
45 45
                 $row .= $this->renderTrace($exception);
46 46
             }
47 47
 
@@ -59,47 +59,47 @@  discard block
 block discarded – undo
59 59
     private function renderTrace(\Throwable $e, Highlighter $h = null): string
60 60
     {
61 61
         $stacktrace = $this->getStacktrace($e);
62
-        if (empty($stacktrace)) {
62
+        if (empty($stacktrace)){
63 63
             return '';
64 64
         }
65 65
 
66 66
         $result = "\nException Trace:\n";
67 67
 
68
-        foreach ($stacktrace as $trace) {
69
-            if (isset($trace['type'], $trace['class'])) {
68
+        foreach ($stacktrace as $trace){
69
+            if (isset($trace['type'], $trace['class'])){
70 70
                 $line = \sprintf(
71 71
                     ' %s%s%s()',
72 72
                     $trace['class'],
73 73
                     $trace['type'],
74 74
                     $trace['function']
75 75
                 );
76
-            } else {
76
+            }else{
77 77
                 $line = $trace['function'];
78 78
             }
79 79
 
80
-            if (isset($trace['file'])) {
80
+            if (isset($trace['file'])){
81 81
                 $line .= \sprintf(' at %s:%s', $trace['file'], $trace['line']);
82
-            } else {
82
+            }else{
83 83
                 $line .= \sprintf(' at %s:%s', 'n/a', 'n/a');
84 84
             }
85 85
 
86
-            if (\in_array($line, $this->lines, true)) {
86
+            if (\in_array($line, $this->lines, true)){
87 87
                 continue;
88 88
             }
89 89
 
90 90
             $this->lines[] = $line;
91 91
 
92
-            $result .= $line . "\n";
92
+            $result .= $line."\n";
93 93
 
94
-            if ($h !== null && !empty($trace['file'])) {
94
+            if ($h !== null && !empty($trace['file'])){
95 95
                 $result .= $h->highlightLines(
96 96
                     \file_get_contents($trace['file']),
97 97
                     $trace['line'],
98 98
                     self::SHOW_LINES
99
-                ) . "\n";
99
+                )."\n";
100 100
             }
101 101
         }
102 102
 
103
-        return $result . "\n";
103
+        return $result."\n";
104 104
     }
105 105
 }
Please login to merge, or discard this patch.