Commit 4cfbf17
committed
Runner: use StatusWriter for caught errors
Errors should go to `STDERR`. This was mostly handled in PR 1010.
However, the `Runner` class contains two `catch (DeepExitException $e)` blocks which are used to exit "early", both for legitimate requests (`--version`, `-i` etc), as well as for error output.
This commit changes how the output is handled in these catch blocks, to differentiate between legitimate requests (exit code `0`) and error output, sending legitimate output to `STDOUT` and sending error output to `STDERR`.
Includes updating a unit test to reflect the change.
Related to squizlabs/PHP_CodeSniffer 16121 parent 1ca08c5 commit 4cfbf17
File tree
2 files changed
+44
-8
lines changed- src
- tests/Core/Runner
2 files changed
+44
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
131 | 140 | | |
132 | 141 | | |
133 | 142 | | |
| |||
212 | 221 | | |
213 | 222 | | |
214 | 223 | | |
215 | | - | |
216 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
217 | 235 | | |
218 | 236 | | |
219 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| 46 | + | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| |||
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| 73 | + | |
| 74 | + | |
69 | 75 | | |
70 | 76 | | |
71 | 77 | | |
| |||
111 | 117 | | |
112 | 118 | | |
113 | 119 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 120 | + | |
118 | 121 | | |
119 | 122 | | |
120 | 123 | | |
121 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
122 | 140 | | |
0 commit comments