Skip to content

Commit

Permalink
Maintain backwards compatability + changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Aug 5, 2014
1 parent d9183f9 commit 1355113
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CodeSniffer/Reporting.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,12 @@ public function cacheFileReport(PHP_CodeSniffer_File $phpcsFile, array $cliValue
if ($output === null) {
// Using a temp file.
if (isset($this->_tmpFiles[$report]) === false) {
$this->_tmpFiles[$report] = fopen(tempnam(sys_get_temp_dir(), 'phpcs'), 'w');
if (function_exists('sys_get_temp_dir') === true) {
// This is needed for HHVM support, but only available from 5.2.1.
$this->_tmpFiles[$report] = fopen(tempnam(sys_get_temp_dir(), 'phpcs'), 'w');
} else {
$this->_tmpFiles[$report] = tmpfile();
}
}

fwrite($this->_tmpFiles[$report], $generatedReport);
Expand All @@ -186,7 +191,7 @@ public function cacheFileReport(PHP_CodeSniffer_File $phpcsFile, array $cliValue
}

file_put_contents($output, $generatedReport, $flags);
}
}//end if
}//end foreach

if ($errorsShown === true) {
Expand Down
2 changes: 2 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
- PHPCBF now exists cleanly when there are no errors to fix
- Added phpcbf.bat file for Windows
- Verbose option no longer errors when using a phar file with a space in the path
- Fixed a reporting error when using HHVM
-- Thanks to Martins Sipenko for the patch
- addFixableError() and addFixableWarning() now only return true if the fixer is enabled
-- Saves checking ($phpcsFile->fixer->enabled === true) before every fix
- Added addErrorOnLine() and addWarningOnLine() to add a non-fixable violation to a line at column 1
Expand Down

0 comments on commit 1355113

Please sign in to comment.