@@ -153,22 +153,13 @@ class File
153153 protected $ warningCount = 0 ;
154154
155155 /**
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).
157157 *
158158 * {@internal This should be regarded as an immutable property.}
159159 *
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>
170161 */
171- private $ fixableWarningCountFirstRun ;
162+ private $ firstRunCounts ;
172163
173164 /**
174165 * The current total number of errors that can be fixed.
@@ -555,14 +546,18 @@ public function process()
555546 StatusWriter::write ('*** END SNIFF PROCESSING REPORT *** ' , 1 );
556547 }
557548
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+ ];
561556 }
562557
563558 $ 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 );
566561
567562 }//end process()
568563
@@ -1217,6 +1212,22 @@ public function getFixedWarningCount()
12171212 }//end getFixedWarningCount()
12181213
12191214
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+
12201231 /**
12211232 * Returns the list of ignored lines.
12221233 *
0 commit comments