Test Failed
Pull Request — master (#853)
by butschster
13:31 queued 06:53
created
src/Exceptions/src/Renderer/PlainRenderer.php 2 patches
Spacing   +14 added lines, -14 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
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         $result = [];
32 32
         $rootDir = \getcwd();
33 33
 
34
-        foreach ($exceptions as $exception) {
34
+        foreach ($exceptions as $exception){
35 35
             $file = \str_starts_with($exception->getFile(), $rootDir)
36 36
                 ? \substr($exception->getFile(), \strlen($rootDir) + 1)
37 37
                 : $exception->getFile();
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
                 $exception->getLine(),
45 45
             );
46 46
 
47
-            if ($verbosity->value >= Verbosity::DEBUG->value) {
47
+            if ($verbosity->value >= Verbosity::DEBUG->value){
48 48
                 $row .= $this->renderTrace($exception, new Highlighter(new PlainStyle()));
49
-            } elseif ($verbosity->value >= Verbosity::VERBOSE->value) {
49
+            } elseif ($verbosity->value >= Verbosity::VERBOSE->value){
50 50
                 $row .= $this->renderTrace($exception);
51 51
             }
52 52
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     private function renderTrace(\Throwable $e, Highlighter $h = null): string
65 65
     {
66 66
         $stacktrace = $this->getStacktrace($e);
67
-        if ($stacktrace === []) {
67
+        if ($stacktrace === []){
68 68
             return '';
69 69
         }
70 70
 
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
 
74 74
         $pad = \strlen((string)\count($stacktrace));
75 75
 
76
-        foreach ($stacktrace as $i => $trace) {
77
-            if (isset($trace['type'], $trace['class'])) {
76
+        foreach ($stacktrace as $i => $trace){
77
+            if (isset($trace['type'], $trace['class'])){
78 78
                 $line = \sprintf(
79 79
                     '%s. %s%s%s()',
80 80
                     \str_pad((string)($i + 1), $pad, ' ', \STR_PAD_LEFT),
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
                     $trace['type'],
83 83
                     $trace['function']
84 84
                 );
85
-            } else {
85
+            }else{
86 86
                 $line = $trace['function'];
87 87
             }
88 88
 
89
-            if (isset($trace['file'])) {
89
+            if (isset($trace['file'])){
90 90
                 $file = \str_starts_with($trace['file'], $rootDir)
91 91
                     ? \substr($trace['file'], \strlen($rootDir) + 1)
92 92
                     : $trace['file'];
@@ -94,23 +94,23 @@  discard block
 block discarded – undo
94 94
                 $line .= \sprintf(' at %s:%s', $file, $trace['line']);
95 95
             }
96 96
 
97
-            if (\in_array($line, $this->lines, true)) {
97
+            if (\in_array($line, $this->lines, true)){
98 98
                 continue;
99 99
             }
100 100
 
101 101
             $this->lines[] = $line;
102 102
 
103
-            $result .= $line . "\n";
103
+            $result .= $line."\n";
104 104
 
105
-            if ($h !== null && !empty($trace['file'])) {
105
+            if ($h !== null && !empty($trace['file'])){
106 106
                 $result .= $h->highlightLines(
107 107
                     \file_get_contents($trace['file']),
108 108
                     $trace['line'],
109 109
                     self::SHOW_LINES
110
-                ) . "\n";
110
+                )."\n";
111 111
             }
112 112
         }
113 113
 
114
-        return $result . "\n";
114
+        return $result."\n";
115 115
     }
116 116
 }
Please login to merge, or discard this patch.
Braces   +24 added lines, -11 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@  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 27
             $exceptions[] = $exception;
27 28
         }
28 29
 
@@ -31,7 +32,8 @@  discard block
 block discarded – undo
31 32
         $result = [];
32 33
         $rootDir = \getcwd();
33 34
 
34
-        foreach ($exceptions as $exception) {
35
+        foreach ($exceptions as $exception)
36
+        {
35 37
             $file = \str_starts_with($exception->getFile(), $rootDir)
36 38
                 ? \substr($exception->getFile(), \strlen($rootDir) + 1)
37 39
                 : $exception->getFile();
@@ -44,9 +46,12 @@  discard block
 block discarded – undo
44 46
                 $exception->getLine(),
45 47
             );
46 48
 
47
-            if ($verbosity->value >= Verbosity::DEBUG->value) {
49
+            if ($verbosity->value >= Verbosity::DEBUG->value)
50
+            {
48 51
                 $row .= $this->renderTrace($exception, new Highlighter(new PlainStyle()));
49
-            } elseif ($verbosity->value >= Verbosity::VERBOSE->value) {
52
+            }
53
+            elseif ($verbosity->value >= Verbosity::VERBOSE->value)
54
+            {
50 55
                 $row .= $this->renderTrace($exception);
51 56
             }
52 57
 
@@ -64,7 +69,8 @@  discard block
 block discarded – undo
64 69
     private function renderTrace(\Throwable $e, Highlighter $h = null): string
65 70
     {
66 71
         $stacktrace = $this->getStacktrace($e);
67
-        if ($stacktrace === []) {
72
+        if ($stacktrace === [])
73
+        {
68 74
             return '';
69 75
         }
70 76
 
@@ -73,8 +79,10 @@  discard block
 block discarded – undo
73 79
 
74 80
         $pad = \strlen((string)\count($stacktrace));
75 81
 
76
-        foreach ($stacktrace as $i => $trace) {
77
-            if (isset($trace['type'], $trace['class'])) {
82
+        foreach ($stacktrace as $i => $trace)
83
+        {
84
+            if (isset($trace['type'], $trace['class']))
85
+            {
78 86
                 $line = \sprintf(
79 87
                     '%s. %s%s%s()',
80 88
                     \str_pad((string)($i + 1), $pad, ' ', \STR_PAD_LEFT),
@@ -82,11 +90,14 @@  discard block
 block discarded – undo
82 90
                     $trace['type'],
83 91
                     $trace['function']
84 92
                 );
85
-            } else {
93
+            }
94
+            else
95
+            {
86 96
                 $line = $trace['function'];
87 97
             }
88 98
 
89
-            if (isset($trace['file'])) {
99
+            if (isset($trace['file']))
100
+            {
90 101
                 $file = \str_starts_with($trace['file'], $rootDir)
91 102
                     ? \substr($trace['file'], \strlen($rootDir) + 1)
92 103
                     : $trace['file'];
@@ -94,7 +105,8 @@  discard block
 block discarded – undo
94 105
                 $line .= \sprintf(' at %s:%s', $file, $trace['line']);
95 106
             }
96 107
 
97
-            if (\in_array($line, $this->lines, true)) {
108
+            if (\in_array($line, $this->lines, true))
109
+            {
98 110
                 continue;
99 111
             }
100 112
 
@@ -102,7 +114,8 @@  discard block
 block discarded – undo
102 114
 
103 115
             $result .= $line . "\n";
104 116
 
105
-            if ($h !== null && !empty($trace['file'])) {
117
+            if ($h !== null && !empty($trace['file']))
118
+            {
106 119
                 $result .= $h->highlightLines(
107 120
                     \file_get_contents($trace['file']),
108 121
                     $trace['line'],
Please login to merge, or discard this patch.