Passed
Pull Request — master (#370)
by Valentin
04:51
created
src/Exceptions/src/Style/HtmlStyle.php 3 patches
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -186,12 +186,14 @@  discard block
 block discarded – undo
186 186
     {
187 187
         $style = $this->getStyle($token, $previous);
188 188
 
189
-        if (strpos($token[1], "\n") === false) {
189
+        if (strpos($token[1], "\n") === false)
190
+        {
190 191
             return sprintf($this->templates['token'], $style, htmlspecialchars($token[1]));
191 192
         }
192 193
 
193 194
         $lines = [];
194
-        foreach (explode("\n", $token[1]) as $line) {
195
+        foreach (explode("\n", $token[1]) as $line)
196
+        {
195 197
             $lines[] = sprintf($this->templates['token'], $style, htmlspecialchars($line));
196 198
         }
197 199
 
@@ -215,16 +217,21 @@  discard block
 block discarded – undo
215 217
      */
216 218
     private function getStyle(array $token, array $previous): string
217 219
     {
218
-        if (!empty($previous)) {
219
-            foreach ($this->style as $style => $tokens) {
220
-                if (in_array($previous[1] . $token[0], $tokens)) {
220
+        if (!empty($previous))
221
+        {
222
+            foreach ($this->style as $style => $tokens)
223
+            {
224
+                if (in_array($previous[1] . $token[0], $tokens))
225
+                {
221 226
                     return $style;
222 227
                 }
223 228
             }
224 229
         }
225 230
 
226
-        foreach ($this->style as $style => $tokens) {
227
-            if (in_array($token[0], $tokens)) {
231
+        foreach ($this->style as $style => $tokens)
232
+        {
233
+            if (in_array($token[0], $tokens))
234
+            {
228 235
                 return $style;
229 236
             }
230 237
         }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     /**
23 23
      * Default code styles.
24 24
      */
25
-    public const DEFAULT = [
25
+    public const default = [
26 26
         'color: blue; font-weight: bold;'   => [
27 27
             T_STATIC,
28 28
             T_PUBLIC,
@@ -169,12 +169,12 @@  discard block
 block discarded – undo
169 169
      *
170 170
      * @var array
171 171
      */
172
-    protected $style = self::DEFAULT;
172
+    protected $style = self::default;
173 173
 
174 174
     /**
175 175
      * @param array $style
176 176
      */
177
-    public function __construct(array $style = self::DEFAULT)
177
+    public function __construct(array $style = self::default)
178 178
     {
179 179
         $this->style = $style;
180 180
     }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -148,8 +148,8 @@  discard block
 block discarded – undo
148 148
             T_VARIABLE,
149 149
         ],
150 150
         'color: #E6D100;'                    => [
151
-            '->' . T_STRING,
152
-            '::' . T_STRING,
151
+            '->'.T_STRING,
152
+            '::'.T_STRING,
153 153
         ],
154 154
     ];
155 155
 
@@ -186,12 +186,12 @@  discard block
 block discarded – undo
186 186
     {
187 187
         $style = $this->getStyle($token, $previous);
188 188
 
189
-        if (strpos($token[1], "\n") === false) {
189
+        if (strpos($token[1], "\n") === false){
190 190
             return sprintf($this->templates['token'], $style, htmlspecialchars($token[1]));
191 191
         }
192 192
 
193 193
         $lines = [];
194
-        foreach (explode("\n", $token[1]) as $line) {
194
+        foreach (explode("\n", $token[1]) as $line){
195 195
             $lines[] = sprintf($this->templates['token'], $style, htmlspecialchars($line));
196 196
         }
197 197
 
@@ -215,16 +215,16 @@  discard block
 block discarded – undo
215 215
      */
216 216
     private function getStyle(array $token, array $previous): string
217 217
     {
218
-        if (!empty($previous)) {
219
-            foreach ($this->style as $style => $tokens) {
220
-                if (in_array($previous[1] . $token[0], $tokens)) {
218
+        if (!empty($previous)){
219
+            foreach ($this->style as $style => $tokens){
220
+                if (in_array($previous[1].$token[0], $tokens)){
221 221
                     return $style;
222 222
                 }
223 223
             }
224 224
         }
225 225
 
226
-        foreach ($this->style as $style => $tokens) {
227
-            if (in_array($token[0], $tokens)) {
226
+        foreach ($this->style as $style => $tokens){
227
+            if (in_array($token[0], $tokens)){
228 228
                 return $style;
229 229
             }
230 230
         }
Please login to merge, or discard this patch.
src/Exceptions/src/Style/PlainStyle.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
      */
32 32
     public function line(int $number, string $code, bool $target = false): string
33 33
     {
34
-        if ($target) {
34
+        if ($target){
35 35
             return sprintf(
36 36
                 ">%s %s\n",
37 37
                 str_pad((string)$number, 4, ' ', STR_PAD_LEFT),
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,8 @@
 block discarded – undo
31 31
      */
32 32
     public function line(int $number, string $code, bool $target = false): string
33 33
     {
34
-        if ($target) {
34
+        if ($target)
35
+        {
35 36
             return sprintf(
36 37
                 ">%s %s\n",
37 38
                 str_pad((string)$number, 4, ' ', STR_PAD_LEFT),
Please login to merge, or discard this patch.
src/Exceptions/src/ConsoleHandler.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
     {
70 70
         $result = '';
71 71
 
72
-        if ($e instanceof \Error) {
73
-            $result .= $this->renderHeader('[' . get_class($e) . "]\n" . $e->getMessage(), 'bg:magenta,white');
74
-        } else {
75
-            $result .= $this->renderHeader('[' . get_class($e) . "]\n" . $e->getMessage(), 'bg:red,white');
72
+        if ($e instanceof \Error){
73
+            $result .= $this->renderHeader('['.get_class($e)."]\n".$e->getMessage(), 'bg:magenta,white');
74
+        }else{
75
+            $result .= $this->renderHeader('['.get_class($e)."]\n".$e->getMessage(), 'bg:red,white');
76 76
         }
77 77
 
78 78
         $result .= $this->format(
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
             $e->getLine()
82 82
         );
83 83
 
84
-        if ($verbosity >= self::VERBOSITY_DEBUG) {
84
+        if ($verbosity >= self::VERBOSITY_DEBUG){
85 85
             $result .= $this->renderTrace($e, new Highlighter(
86 86
                 $this->colorsSupport ? new ConsoleStyle() : new PlainStyle()
87 87
             ));
88
-        } elseif ($verbosity >= self::VERBOSITY_VERBOSE) {
88
+        } elseif ($verbosity >= self::VERBOSITY_VERBOSE){
89 89
             $result .= $this->renderTrace($e);
90 90
         }
91 91
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
         $length += $padding;
115 115
 
116
-        foreach ($lines as $line) {
116
+        foreach ($lines as $line){
117 117
             $result .= $this->format(
118 118
                 "<{$style}>%s%s%s</reset>\n",
119 119
                 str_repeat(' ', $padding + 1),
@@ -135,34 +135,34 @@  discard block
 block discarded – undo
135 135
     private function renderTrace(\Throwable $e, Highlighter $h = null): string
136 136
     {
137 137
         $stacktrace = $this->getStacktrace($e);
138
-        if (empty($stacktrace)) {
138
+        if (empty($stacktrace)){
139 139
             return '';
140 140
         }
141 141
 
142 142
         $result = $this->format("\n<red>Exception Trace:</reset>\n");
143 143
 
144
-        foreach ($stacktrace as $trace) {
145
-            if (isset($trace['type']) && isset($trace['class'])) {
144
+        foreach ($stacktrace as $trace){
145
+            if (isset($trace['type']) && isset($trace['class'])){
146 146
                 $line = $this->format(
147 147
                     ' <white>%s%s%s()</reset>',
148 148
                     $trace['class'],
149 149
                     $trace['type'],
150 150
                     $trace['function']
151 151
                 );
152
-            } else {
152
+            }else{
153 153
                 $line = $this->format(
154 154
                     ' <white>%s()</reset>',
155 155
                     $trace['function']
156 156
                 );
157 157
             }
158 158
 
159
-            if (isset($trace['file'])) {
159
+            if (isset($trace['file'])){
160 160
                 $line .= $this->format(
161 161
                     ' <yellow>at</reset> <green>%s</reset><yellow>:</reset><white>%s</reset>',
162 162
                     $trace['file'],
163 163
                     $trace['line']
164 164
                 );
165
-            } else {
165
+            }else{
166 166
                 $line .= $this->format(
167 167
                     ' <yellow>at</reset> <green>%s</reset><yellow>:</reset><white>%s</reset>',
168 168
                     'n/a',
@@ -170,14 +170,14 @@  discard block
 block discarded – undo
170 170
                 );
171 171
             }
172 172
 
173
-            $result .= $line . "\n";
173
+            $result .= $line."\n";
174 174
 
175
-            if (!empty($h) && !empty($trace['file'])) {
175
+            if (!empty($h) && !empty($trace['file'])){
176 176
                 $result .= $h->highlightLines(
177 177
                     file_get_contents($trace['file']),
178 178
                     $trace['line'],
179 179
                     static::SHOW_LINES
180
-                ) . "\n";
180
+                )."\n";
181 181
             }
182 182
         }
183 183
 
@@ -193,13 +193,13 @@  discard block
 block discarded – undo
193 193
      */
194 194
     private function format(string $format, ...$args): string
195 195
     {
196
-        if (!$this->colorsSupport) {
196
+        if (!$this->colorsSupport){
197 197
             $format = preg_replace('/<[^>]+>/', '', $format);
198
-        } else {
199
-            $format = preg_replace_callback('/(<([^>]+)>)/', function ($partial) {
198
+        }else{
199
+            $format = preg_replace_callback('/(<([^>]+)>)/', function ($partial){
200 200
                 $style = '';
201
-                foreach (explode(',', trim($partial[2], '/')) as $color) {
202
-                    if (isset(self::COLORS[$color])) {
201
+                foreach (explode(',', trim($partial[2], '/')) as $color){
202
+                    if (isset(self::COLORS[$color])){
203 203
                         $style .= self::COLORS[$color];
204 204
                     }
205 205
                 }
Please login to merge, or discard this patch.
Braces   +39 added lines, -17 removed lines patch added patch discarded remove patch
@@ -69,9 +69,12 @@  discard block
 block discarded – undo
69 69
     {
70 70
         $result = '';
71 71
 
72
-        if ($e instanceof \Error) {
72
+        if ($e instanceof \Error)
73
+        {
73 74
             $result .= $this->renderHeader('[' . get_class($e) . "]\n" . $e->getMessage(), 'bg:magenta,white');
74
-        } else {
75
+        }
76
+        else
77
+        {
75 78
             $result .= $this->renderHeader('[' . get_class($e) . "]\n" . $e->getMessage(), 'bg:red,white');
76 79
         }
77 80
 
@@ -81,11 +84,14 @@  discard block
 block discarded – undo
81 84
             $e->getLine()
82 85
         );
83 86
 
84
-        if ($verbosity >= self::VERBOSITY_DEBUG) {
87
+        if ($verbosity >= self::VERBOSITY_DEBUG)
88
+        {
85 89
             $result .= $this->renderTrace($e, new Highlighter(
86 90
                 $this->colorsSupport ? new ConsoleStyle() : new PlainStyle()
87 91
             ));
88
-        } elseif ($verbosity >= self::VERBOSITY_VERBOSE) {
92
+        }
93
+        elseif ($verbosity >= self::VERBOSITY_VERBOSE)
94
+        {
89 95
             $result .= $this->renderTrace($e);
90 96
         }
91 97
 
@@ -113,7 +119,8 @@  discard block
 block discarded – undo
113 119
 
114 120
         $length += $padding;
115 121
 
116
-        foreach ($lines as $line) {
122
+        foreach ($lines as $line)
123
+        {
117 124
             $result .= $this->format(
118 125
                 "<{$style}>%s%s%s</reset>\n",
119 126
                 str_repeat(' ', $padding + 1),
@@ -135,34 +142,42 @@  discard block
 block discarded – undo
135 142
     private function renderTrace(\Throwable $e, Highlighter $h = null): string
136 143
     {
137 144
         $stacktrace = $this->getStacktrace($e);
138
-        if (empty($stacktrace)) {
145
+        if (empty($stacktrace))
146
+        {
139 147
             return '';
140 148
         }
141 149
 
142 150
         $result = $this->format("\n<red>Exception Trace:</reset>\n");
143 151
 
144
-        foreach ($stacktrace as $trace) {
145
-            if (isset($trace['type']) && isset($trace['class'])) {
152
+        foreach ($stacktrace as $trace)
153
+        {
154
+            if (isset($trace['type']) && isset($trace['class']))
155
+            {
146 156
                 $line = $this->format(
147 157
                     ' <white>%s%s%s()</reset>',
148 158
                     $trace['class'],
149 159
                     $trace['type'],
150 160
                     $trace['function']
151 161
                 );
152
-            } else {
162
+            }
163
+            else
164
+            {
153 165
                 $line = $this->format(
154 166
                     ' <white>%s()</reset>',
155 167
                     $trace['function']
156 168
                 );
157 169
             }
158 170
 
159
-            if (isset($trace['file'])) {
171
+            if (isset($trace['file']))
172
+            {
160 173
                 $line .= $this->format(
161 174
                     ' <yellow>at</reset> <green>%s</reset><yellow>:</reset><white>%s</reset>',
162 175
                     $trace['file'],
163 176
                     $trace['line']
164 177
                 );
165
-            } else {
178
+            }
179
+            else
180
+            {
166 181
                 $line .= $this->format(
167 182
                     ' <yellow>at</reset> <green>%s</reset><yellow>:</reset><white>%s</reset>',
168 183
                     'n/a',
@@ -172,7 +187,8 @@  discard block
 block discarded – undo
172 187
 
173 188
             $result .= $line . "\n";
174 189
 
175
-            if (!empty($h) && !empty($trace['file'])) {
190
+            if (!empty($h) && !empty($trace['file']))
191
+            {
176 192
                 $result .= $h->highlightLines(
177 193
                     file_get_contents($trace['file']),
178 194
                     $trace['line'],
@@ -193,13 +209,19 @@  discard block
 block discarded – undo
193 209
      */
194 210
     private function format(string $format, ...$args): string
195 211
     {
196
-        if (!$this->colorsSupport) {
212
+        if (!$this->colorsSupport)
213
+        {
197 214
             $format = preg_replace('/<[^>]+>/', '', $format);
198
-        } else {
199
-            $format = preg_replace_callback('/(<([^>]+)>)/', function ($partial) {
215
+        }
216
+        else
217
+        {
218
+            $format = preg_replace_callback('/(<([^>]+)>)/', function ($partial)
219
+            {
200 220
                 $style = '';
201
-                foreach (explode(',', trim($partial[2], '/')) as $color) {
202
-                    if (isset(self::COLORS[$color])) {
221
+                foreach (explode(',', trim($partial[2], '/')) as $color)
222
+                {
223
+                    if (isset(self::COLORS[$color]))
224
+                    {
203 225
                         $style .= self::COLORS[$color];
204 226
                     }
205 227
                 }
Please login to merge, or discard this patch.
src/Exceptions/src/Highlighter.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@  discard block
 block discarded – undo
40 40
         $lines = explode("\n", str_replace("\r\n", "\n", $this->highlight($source)));
41 41
 
42 42
         $result = '';
43
-        foreach ($lines as $number => $code) {
43
+        foreach ($lines as $number => $code){
44 44
             $human = $number + 1;
45
-            if (!empty($around) && ($human < $line - $around || $human >= $line + $around + 1)) {
45
+            if (!empty($around) && ($human < $line - $around || $human >= $line + $around + 1)){
46 46
                 //Not included in a range
47 47
                 continue;
48 48
             }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     {
64 64
         $result = '';
65 65
         $previous = [];
66
-        foreach ($this->getTokens($source) as $token) {
66
+        foreach ($this->getTokens($source) as $token){
67 67
             $result .= $this->r->token($token, $previous);
68 68
             $previous = $token;
69 69
         }
@@ -82,12 +82,12 @@  discard block
 block discarded – undo
82 82
         $tokens = [];
83 83
         $line = 0;
84 84
 
85
-        foreach (token_get_all($source) as $token) {
86
-            if (isset($token[2])) {
85
+        foreach (token_get_all($source) as $token){
86
+            if (isset($token[2])){
87 87
                 $line = $token[2];
88 88
             }
89 89
 
90
-            if (!is_array($token)) {
90
+            if (!is_array($token)){
91 91
                 $token = [$token, $token, $line];
92 92
             }
93 93
 
Please login to merge, or discard this patch.
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,9 +40,11 @@  discard block
 block discarded – undo
40 40
         $lines = explode("\n", str_replace("\r\n", "\n", $this->highlight($source)));
41 41
 
42 42
         $result = '';
43
-        foreach ($lines as $number => $code) {
43
+        foreach ($lines as $number => $code)
44
+        {
44 45
             $human = $number + 1;
45
-            if (!empty($around) && ($human < $line - $around || $human >= $line + $around + 1)) {
46
+            if (!empty($around) && ($human < $line - $around || $human >= $line + $around + 1))
47
+            {
46 48
                 //Not included in a range
47 49
                 continue;
48 50
             }
@@ -63,7 +65,8 @@  discard block
 block discarded – undo
63 65
     {
64 66
         $result = '';
65 67
         $previous = [];
66
-        foreach ($this->getTokens($source) as $token) {
68
+        foreach ($this->getTokens($source) as $token)
69
+        {
67 70
             $result .= $this->r->token($token, $previous);
68 71
             $previous = $token;
69 72
         }
@@ -82,12 +85,15 @@  discard block
 block discarded – undo
82 85
         $tokens = [];
83 86
         $line = 0;
84 87
 
85
-        foreach (token_get_all($source) as $token) {
86
-            if (isset($token[2])) {
88
+        foreach (token_get_all($source) as $token)
89
+        {
90
+            if (isset($token[2]))
91
+            {
87 92
                 $line = $token[2];
88 93
             }
89 94
 
90
-            if (!is_array($token)) {
95
+            if (!is_array($token))
96
+            {
91 97
                 $token = [$token, $token, $line];
92 98
             }
93 99
 
Please login to merge, or discard this patch.
src/Exceptions/src/ValueWrapper.php 3 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -56,33 +56,33 @@
 block discarded – undo
56 56
     public function wrap(array $args): array
57 57
     {
58 58
         $result = [];
59
-        foreach ($args as $arg) {
59
+        foreach ($args as $arg){
60 60
             $display = $type = strtolower(gettype($arg));
61 61
 
62
-            if (is_numeric($arg)) {
62
+            if (is_numeric($arg)){
63 63
                 $result[] = $this->r->apply($arg, 'value', $type);
64 64
                 continue;
65
-            } elseif (is_bool($arg)) {
65
+            } elseif (is_bool($arg)){
66 66
                 $result[] = $this->r->apply($arg ? 'true' : 'false', 'value', $type);
67 67
                 continue;
68
-            } elseif (is_null($arg)) {
68
+            } elseif (is_null($arg)){
69 69
                 $result[] = $this->r->apply('null', 'value', $type);
70 70
                 continue;
71 71
             }
72 72
 
73
-            if (is_object($arg)) {
73
+            if (is_object($arg)){
74 74
                 $reflection = new \ReflectionClass($arg);
75 75
                 $display = sprintf('<span title="%s">%s</span>', $reflection->getName(), $reflection->getShortName());
76 76
             }
77 77
 
78 78
             $type = $this->r->apply($display, 'value', $type);
79 79
 
80
-            if ($this->verbosity < HandlerInterface::VERBOSITY_DEBUG) {
80
+            if ($this->verbosity < HandlerInterface::VERBOSITY_DEBUG){
81 81
                 $result[] = sprintf('<span>%s</span>', $type);
82
-            } else {
82
+            }else{
83 83
                 $hash = is_object($arg) ? spl_object_hash($arg) : md5(json_encode($arg));
84 84
 
85
-                if (!isset($this->values[$hash])) {
85
+                if (!isset($this->values[$hash])){
86 86
                     $this->values[$hash] = $this->dumper->dump($arg, Dumper::RETURN);
87 87
                 }
88 88
 
Please login to merge, or discard this patch.
Braces   +19 added lines, -8 removed lines patch added patch discarded remove patch
@@ -56,33 +56,44 @@
 block discarded – undo
56 56
     public function wrap(array $args): array
57 57
     {
58 58
         $result = [];
59
-        foreach ($args as $arg) {
59
+        foreach ($args as $arg)
60
+        {
60 61
             $display = $type = strtolower(gettype($arg));
61 62
 
62
-            if (is_numeric($arg)) {
63
+            if (is_numeric($arg))
64
+            {
63 65
                 $result[] = $this->r->apply($arg, 'value', $type);
64 66
                 continue;
65
-            } elseif (is_bool($arg)) {
67
+            }
68
+            elseif (is_bool($arg))
69
+            {
66 70
                 $result[] = $this->r->apply($arg ? 'true' : 'false', 'value', $type);
67 71
                 continue;
68
-            } elseif (is_null($arg)) {
72
+            }
73
+            elseif (is_null($arg))
74
+            {
69 75
                 $result[] = $this->r->apply('null', 'value', $type);
70 76
                 continue;
71 77
             }
72 78
 
73
-            if (is_object($arg)) {
79
+            if (is_object($arg))
80
+            {
74 81
                 $reflection = new \ReflectionClass($arg);
75 82
                 $display = sprintf('<span title="%s">%s</span>', $reflection->getName(), $reflection->getShortName());
76 83
             }
77 84
 
78 85
             $type = $this->r->apply($display, 'value', $type);
79 86
 
80
-            if ($this->verbosity < HandlerInterface::VERBOSITY_DEBUG) {
87
+            if ($this->verbosity < HandlerInterface::VERBOSITY_DEBUG)
88
+            {
81 89
                 $result[] = sprintf('<span>%s</span>', $type);
82
-            } else {
90
+            }
91
+            else
92
+            {
83 93
                 $hash = is_object($arg) ? spl_object_hash($arg) : md5(json_encode($arg));
84 94
 
85
-                if (!isset($this->values[$hash])) {
95
+                if (!isset($this->values[$hash]))
96
+                {
86 97
                     $this->values[$hash] = $this->dumper->dump($arg, Dumper::RETURN);
87 98
                 }
88 99
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
                 $hash = is_object($arg) ? spl_object_hash($arg) : md5(json_encode($arg));
84 84
 
85 85
                 if (!isset($this->values[$hash])) {
86
-                    $this->values[$hash] = $this->dumper->dump($arg, Dumper::RETURN);
86
+                    $this->values[$hash] = $this->dumper->dump($arg, Dumper::return);
87 87
                 }
88 88
 
89 89
                 $result[] = sprintf('<span onclick="_da(\'%s\')">%s</span>', $hash, $type);
Please login to merge, or discard this patch.
src/Exceptions/tests/HandlerTest.php 3 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -201,9 +201,9 @@  discard block
 block discarded – undo
201 201
         $handler = new ConsoleHandler();
202 202
         $handler->setColorsSupport(true);
203 203
 
204
-        try {
204
+        try{
205 205
             $this->makeException();
206
-        } catch (\Throwable $e) {
206
+        }catch (\Throwable $e){
207 207
         }
208 208
 
209 209
         $result = $handler->renderException($e, HandlerInterface::VERBOSITY_DEBUG);
@@ -217,9 +217,9 @@  discard block
 block discarded – undo
217 217
     {
218 218
         $handler = new PlainHandler();
219 219
 
220
-        try {
220
+        try{
221 221
             $this->makeException();
222
-        } catch (\Throwable $e) {
222
+        }catch (\Throwable $e){
223 223
         }
224 224
 
225 225
         $result = $handler->renderException($e, HandlerInterface::VERBOSITY_DEBUG);
@@ -232,9 +232,9 @@  discard block
 block discarded – undo
232 232
     {
233 233
         $handler = new JsonHandler();
234 234
 
235
-        try {
235
+        try{
236 236
             $this->makeException();
237
-        } catch (\Throwable $e) {
237
+        }catch (\Throwable $e){
238 238
         }
239 239
 
240 240
         $result = $handler->renderException($e, HandlerInterface::VERBOSITY_DEBUG);
@@ -249,9 +249,9 @@  discard block
 block discarded – undo
249 249
 
250 250
         $handler = new HtmlHandler(HtmlHandler::DEFAULT);
251 251
 
252
-        try {
252
+        try{
253 253
             $this->makeException();
254
-        } catch (\Throwable $e) {
254
+        }catch (\Throwable $e){
255 255
         }
256 256
 
257 257
         $result = $handler->renderException($e, HandlerInterface::VERBOSITY_DEBUG);
@@ -267,9 +267,9 @@  discard block
 block discarded – undo
267 267
 
268 268
         $handler = new HtmlHandler(HtmlHandler::INVERTED);
269 269
 
270
-        try {
270
+        try{
271 271
             $this->makeException();
272
-        } catch (\Throwable $e) {
272
+        }catch (\Throwable $e){
273 273
         }
274 274
 
275 275
         $result = $handler->renderException($e, HandlerInterface::VERBOSITY_DEBUG);
@@ -281,13 +281,13 @@  discard block
 block discarded – undo
281 281
 
282 282
     public function makeException(): void
283 283
     {
284
-        try {
284
+        try{
285 285
             $f = function (): void {
286 286
                 throw new \RuntimeException('error');
287 287
             };
288 288
 
289 289
             $f();
290
-        } catch (\Throwable $e) {
290
+        }catch (\Throwable $e){
291 291
             throw new \LogicException('error', 0, $e);
292 292
         }
293 293
     }
Please login to merge, or discard this patch.
Braces   +30 added lines, -12 removed lines patch added patch discarded remove patch
@@ -201,9 +201,12 @@  discard block
 block discarded – undo
201 201
         $handler = new ConsoleHandler();
202 202
         $handler->setColorsSupport(true);
203 203
 
204
-        try {
204
+        try
205
+        {
205 206
             $this->makeException();
206
-        } catch (\Throwable $e) {
207
+        }
208
+        catch (\Throwable $e)
209
+        {
207 210
         }
208 211
 
209 212
         $result = $handler->renderException($e, HandlerInterface::VERBOSITY_DEBUG);
@@ -217,9 +220,12 @@  discard block
 block discarded – undo
217 220
     {
218 221
         $handler = new PlainHandler();
219 222
 
220
-        try {
223
+        try
224
+        {
221 225
             $this->makeException();
222
-        } catch (\Throwable $e) {
226
+        }
227
+        catch (\Throwable $e)
228
+        {
223 229
         }
224 230
 
225 231
         $result = $handler->renderException($e, HandlerInterface::VERBOSITY_DEBUG);
@@ -232,9 +238,12 @@  discard block
 block discarded – undo
232 238
     {
233 239
         $handler = new JsonHandler();
234 240
 
235
-        try {
241
+        try
242
+        {
236 243
             $this->makeException();
237
-        } catch (\Throwable $e) {
244
+        }
245
+        catch (\Throwable $e)
246
+        {
238 247
         }
239 248
 
240 249
         $result = $handler->renderException($e, HandlerInterface::VERBOSITY_DEBUG);
@@ -249,9 +258,12 @@  discard block
 block discarded – undo
249 258
 
250 259
         $handler = new HtmlHandler(HtmlHandler::DEFAULT);
251 260
 
252
-        try {
261
+        try
262
+        {
253 263
             $this->makeException();
254
-        } catch (\Throwable $e) {
264
+        }
265
+        catch (\Throwable $e)
266
+        {
255 267
         }
256 268
 
257 269
         $result = $handler->renderException($e, HandlerInterface::VERBOSITY_DEBUG);
@@ -267,9 +279,12 @@  discard block
 block discarded – undo
267 279
 
268 280
         $handler = new HtmlHandler(HtmlHandler::INVERTED);
269 281
 
270
-        try {
282
+        try
283
+        {
271 284
             $this->makeException();
272
-        } catch (\Throwable $e) {
285
+        }
286
+        catch (\Throwable $e)
287
+        {
273 288
         }
274 289
 
275 290
         $result = $handler->renderException($e, HandlerInterface::VERBOSITY_DEBUG);
@@ -281,13 +296,16 @@  discard block
 block discarded – undo
281 296
 
282 297
     public function makeException(): void
283 298
     {
284
-        try {
299
+        try
300
+        {
285 301
             $f = function (): void {
286 302
                 throw new \RuntimeException('error');
287 303
             };
288 304
 
289 305
             $f();
290
-        } catch (\Throwable $e) {
306
+        }
307
+        catch (\Throwable $e)
308
+        {
291 309
             throw new \LogicException('error', 0, $e);
292 310
         }
293 311
     }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
     public function testHtmlHandlerDefaultBasic(): void
115 115
     {
116
-        $handler = new HtmlHandler(HtmlHandler::DEFAULT);
116
+        $handler = new HtmlHandler(HtmlHandler::default);
117 117
 
118 118
         $result = $handler->renderException(new Error(
119 119
             'message',
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
     {
165 165
         $this->markTestSkipped('FIXME: Very long execution time');
166 166
 
167
-        $handler = new HtmlHandler(HtmlHandler::DEFAULT);
167
+        $handler = new HtmlHandler(HtmlHandler::default);
168 168
 
169 169
         $result = $handler->renderException(new Error(
170 170
             'message',
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
     {
248 248
         $this->markTestSkipped('FIXME: Very long execution time');
249 249
 
250
-        $handler = new HtmlHandler(HtmlHandler::DEFAULT);
250
+        $handler = new HtmlHandler(HtmlHandler::default);
251 251
 
252 252
         try {
253 253
             $this->makeException();
Please login to merge, or discard this patch.
src/Console/src/StaticLocator.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     public function locateCommands(): array
39 39
     {
40 40
         $commands = [];
41
-        foreach ($this->commands as $command) {
41
+        foreach ($this->commands as $command){
42 42
             $commands[] = $this->factory->get($command);
43 43
         }
44 44
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,8 @@
 block discarded – undo
38 38
     public function locateCommands(): array
39 39
     {
40 40
         $commands = [];
41
-        foreach ($this->commands as $command) {
41
+        foreach ($this->commands as $command)
42
+        {
42 43
             $commands[] = $this->factory->get($command);
43 44
         }
44 45
 
Please login to merge, or discard this patch.
src/Console/src/Sequence/CommandSequence.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
         array $options = [],
38 38
         string $header = '',
39 39
         string $footer = ''
40
-    ) {
40
+    ){
41 41
         $this->command = $command;
42 42
         $this->options = $options;
43 43
 
Please login to merge, or discard this patch.
src/Console/src/Sequence/AbstractSequence.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      */
38 38
     public function writeHeader(OutputInterface $output): void
39 39
     {
40
-        if (!empty($this->header)) {
40
+        if (!empty($this->header)){
41 41
             $output->writeln($this->header);
42 42
         }
43 43
     }
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public function whiteFooter(OutputInterface $output): void
49 49
     {
50
-        if (!empty($this->footer)) {
50
+        if (!empty($this->footer)){
51 51
             $output->writeln($this->footer);
52 52
         }
53 53
     }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,8 @@  discard block
 block discarded – undo
37 37
      */
38 38
     public function writeHeader(OutputInterface $output): void
39 39
     {
40
-        if (!empty($this->header)) {
40
+        if (!empty($this->header))
41
+        {
41 42
             $output->writeln($this->header);
42 43
         }
43 44
     }
@@ -47,7 +48,8 @@  discard block
 block discarded – undo
47 48
      */
48 49
     public function whiteFooter(OutputInterface $output): void
49 50
     {
50
-        if (!empty($this->footer)) {
51
+        if (!empty($this->footer))
52
+        {
51 53
             $output->writeln($this->footer);
52 54
         }
53 55
     }
Please login to merge, or discard this patch.