Skip to content

Commit

Permalink
Fixed bug squizlabs#473 : Writing a report for an empty folder to exi…
Browse files Browse the repository at this point in the history
…sting file includes the existing contents
  • Loading branch information
gsherwood committed Feb 3, 2015
1 parent 2f75556 commit cc19ee1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CodeSniffer/Reporting.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ public function printReport(
$filename = $reportFile;
$toScreen = false;

if (file_exists($filename) === true) {
if (file_exists($filename) === true
&& isset($this->_cachedReports[$report]) === true
) {
$reportCache = file_get_contents($filename);
} else {
$reportCache = '';
Expand Down
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
- Fixed bug #453 : PSR2 standard does not allow closing tag for mixed PHP/HTML files
- Fixed bug #457 : FunctionCallSignature sniffs do not support here/nowdoc syntax and can cause syntax error when fixing
- Fixed bug #466 : PropertyLabelSpacing JS fixer issue when there is no space after colon
- Fixed bug #473 : Writing a report for an empty folder to existing file includes the existing contents
</notes>
<contents>
<dir name="/">
Expand Down

0 comments on commit cc19ee1

Please sign in to comment.