Skip to content

Commit

Permalink
Fixed problem where some file content could be ignored when checking …
Browse files Browse the repository at this point in the history
…STDIN
  • Loading branch information
gsherwood committed Aug 30, 2013
1 parent 0f4aa9c commit 4c3c7b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
18 changes: 9 additions & 9 deletions CodeSniffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1317,17 +1317,17 @@ public function processFile($file, $contents=null)
$firstContent = fgets($handle);
$firstContent .= fgets($handle);
fclose($handle);
}
}

if (strpos($firstContent, '@codingStandardsIgnoreFile') !== false) {
// We are ignoring the whole file.
if (PHP_CODESNIFFER_VERBOSITY > 0) {
echo 'Ignoring '.basename($filePath).PHP_EOL;
}
if (strpos($firstContent, '@codingStandardsIgnoreFile') !== false) {
// We are ignoring the whole file.
if (PHP_CODESNIFFER_VERBOSITY > 0) {
echo 'Ignoring '.basename($filePath).PHP_EOL;
}

return null;
}
return null;
}
}
}//end if

try {
$phpcsFile = $this->_processFile($file, $contents);
Expand Down
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
<license uri="https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt">BSD 3-Clause License</license>
<notes>
- Added support for the PHP 5.4 callable type hint
- Fixed problem where some file content could be ignored when checking STDIN
- PEAR MultiLineConditionSniff now has a setting to specify how many spaces code should be indented
-- Default remains at 4; override the 'indent' setting in a ruleset.xml file to change
-- Thanks to Szabolcs Sulik for the patch
Expand Down

0 comments on commit 4c3c7b0

Please sign in to comment.