File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 23
23
24
24
class Runner
25
25
{
26
+ const SUCCESS = 0 ;
27
+ const FAILURE = 1 ;
28
+ const INVALID = 2 ;
26
29
27
30
/**
28
31
* The config data for the run.
@@ -81,7 +84,7 @@ public function runPHPCS()
81
84
$ ruleset ->explain ();
82
85
}
83
86
84
- return 0 ;
87
+ return self :: SUCCESS ;
85
88
}
86
89
87
90
// Generate documentation for each of the supplied standards.
@@ -95,7 +98,7 @@ public function runPHPCS()
95
98
$ generator ->generate ();
96
99
}
97
100
98
- return 0 ;
101
+ return self :: SUCCESS ;
99
102
}
100
103
101
104
// Other report formats don't really make sense in interactive mode
@@ -136,13 +139,13 @@ public function runPHPCS()
136
139
137
140
if ($ numErrors === 0 ) {
138
141
// No errors found.
139
- return 0 ;
142
+ return self :: SUCCESS ;
140
143
} else if ($ this ->reporter ->totalFixable === 0 ) {
141
144
// Errors found, but none of them can be fixed by PHPCBF.
142
- return 1 ;
145
+ return self :: FAILURE ;
143
146
} else {
144
147
// Errors found, and some can be fixed by PHPCBF.
145
- return 2 ;
148
+ return self :: INVALID ;
146
149
}
147
150
148
151
}//end runPHPCS()
@@ -215,20 +218,20 @@ public function runPHPCBF()
215
218
// Nothing was fixed by PHPCBF.
216
219
if ($ this ->reporter ->totalFixable === 0 ) {
217
220
// Nothing found that could be fixed.
218
- return 0 ;
221
+ return self :: SUCCESS ;
219
222
} else {
220
223
// Something failed to fix.
221
- return 2 ;
224
+ return self :: INVALID ;
222
225
}
223
226
}
224
227
225
228
if ($ this ->reporter ->totalFixable === 0 ) {
226
229
// PHPCBF fixed all fixable errors.
227
- return 1 ;
230
+ return self :: FAILURE ;
228
231
}
229
232
230
233
// PHPCBF fixed some fixable errors, but others failed to fix.
231
- return 2 ;
234
+ return self :: INVALID ;
232
235
233
236
}//end runPHPCBF()
234
237
You can’t perform that action at this time.
0 commit comments