diff --git a/src/Reports/Code.php b/src/Reports/Code.php index c97e1681b7..18aaf1e144 100644 --- a/src/Reports/Code.php +++ b/src/Reports/Code.php @@ -55,6 +55,10 @@ public function generateFileReport($report, File $phpcsFile, $showSources=false, try { $phpcsFile->parse(); + + // Make sure the fixer is aware of the reparsed file to prevent a race-condition + // with the Diff report also re-parsing the file. + $phpcsFile->fixer->startFile($phpcsFile); } catch (Exception $e) { // This is a second parse, so ignore exceptions. // They would have been added to the file's error list already.