Skip to content

Commit

Permalink
Fixed bug #1746 : Very large reports can sometimes become garbled whe…
Browse files Browse the repository at this point in the history
…n using the parallel option
  • Loading branch information
gsherwood committed Nov 8, 2017
1 parent 5ad186a commit 53ba7e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
-- Thanks to Nikola Kovacs for the patch
- Fixed bug #1718 : Unclosed strings at EOF sometimes tokenized as T_WHITESPACE by the JS tokenizer
- Fixed bug #1731 : Directory exclusions do not work as expected when a single file name is passed to phpcs
- Fixed bug #1746 : Very large reports can sometimes become garbled when using the parallel option
</notes>
<contents>
<dir name="/">
Expand Down
5 changes: 2 additions & 3 deletions src/Reporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,9 @@ public function cacheFileReport(File $phpcsFile)
file_put_contents($this->tmpFiles[$type], '');
}

file_put_contents($this->tmpFiles[$type], $generatedReport, FILE_APPEND);
file_put_contents($this->tmpFiles[$type], $generatedReport, (FILE_APPEND | LOCK_EX));
} else {
$flags = FILE_APPEND;
file_put_contents($report['output'], $generatedReport, FILE_APPEND);
file_put_contents($report['output'], $generatedReport, (FILE_APPEND | LOCK_EX));
}//end if
}//end foreach

Expand Down

0 comments on commit 53ba7e2

Please sign in to comment.