@@ -153,22 +153,13 @@ class File
153
153
protected $ warningCount = 0 ;
154
154
155
155
/**
156
- * The original total number of errors that can be fixed (first run on a file).
156
+ * The original total number of errors and warnings (first run on a file).
157
157
*
158
158
* {@internal This should be regarded as an immutable property.}
159
159
*
160
- * @var integer
161
- */
162
- private $ fixableErrorCountFirstRun ;
163
-
164
- /**
165
- * The original total number of warnings that can be fixed (first run on a file).
166
- *
167
- * {@internal This should be regarded as an immutable property.}
168
- *
169
- * @var integer
160
+ * @var array<string, int>
170
161
*/
171
- private $ fixableWarningCountFirstRun ;
162
+ private $ firstRunCounts ;
172
163
173
164
/**
174
165
* The current total number of errors that can be fixed.
@@ -555,14 +546,18 @@ public function process()
555
546
StatusWriter::write ('*** END SNIFF PROCESSING REPORT *** ' , 1 );
556
547
}
557
548
558
- if (isset ($ this ->fixableErrorCountFirstRun , $ this ->fixableWarningCountFirstRun ) === false ) {
559
- $ this ->fixableErrorCountFirstRun = $ this ->fixableErrorCount ;
560
- $ this ->fixableWarningCountFirstRun = $ this ->fixableWarningCount ;
549
+ if (isset ($ this ->firstRunCounts ) === false ) {
550
+ $ this ->firstRunCounts = [
551
+ 'error ' => $ this ->errorCount ,
552
+ 'warning ' => $ this ->warningCount ,
553
+ 'fixableError ' => $ this ->fixableErrorCount ,
554
+ 'fixableWarning ' => $ this ->fixableWarningCount ,
555
+ ];
561
556
}
562
557
563
558
$ this ->fixedCount += $ this ->fixer ->getFixCount ();
564
- $ this ->fixedErrorCount = ($ this ->fixableErrorCountFirstRun - $ this ->fixableErrorCount );
565
- $ this ->fixedWarningCount = ($ this ->fixableWarningCountFirstRun - $ this ->fixableWarningCount );
559
+ $ this ->fixedErrorCount = ($ this ->firstRunCounts [ ' fixableError ' ] - $ this ->fixableErrorCount );
560
+ $ this ->fixedWarningCount = ($ this ->firstRunCounts [ ' fixableWarning ' ] - $ this ->fixableWarningCount );
566
561
567
562
}//end process()
568
563
@@ -1217,6 +1212,22 @@ public function getFixedWarningCount()
1217
1212
}//end getFixedWarningCount()
1218
1213
1219
1214
1215
+ /**
1216
+ * Retrieve information about the first run.
1217
+ *
1218
+ * @param $type string
1219
+ *
1220
+ * @internal This method does not form part of any public API nor backwards compatibility guarantee.
1221
+ *
1222
+ * @return int
1223
+ */
1224
+ public function getFirstRunCount (string $ type ):int
1225
+ {
1226
+ return $ this ->firstRunCounts [$ type ];
1227
+
1228
+ }//end getFirstRunCount()
1229
+
1230
+
1220
1231
/**
1221
1232
* Returns the list of ignored lines.
1222
1233
*
0 commit comments