Skip to content

Commit

Permalink
Changelog + minor error message change for squizlabs#2122
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Aug 24, 2018
1 parent 223ad31 commit a5377f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
-- Thanks to Juliette Reinders Folmer for the patch
- The Squiz standard now ensures underscores are not used to indicate visibility of private members vars and methods
-- Previously, this standard enforced the use of underscores
- Generic.PHP.NoSilencedErrors error messages now contain a code snippet to show the context of the error
-- Thanks to Juliette Reinders Folmer for the patch
- Squiz.Commenting.FunctionComment no longer errors when trying to fix indents of multi-line param comments
- Fixed a problem where referencing a relative file path in a ruleset XML file could add unnecessary sniff exclusions
-- This didn't actually exclude anything, but caused verbose output to list strange exclusion rules
Expand Down
4 changes: 2 additions & 2 deletions src/Standards/Generic/Sniffs/PHP/NoSilencedErrorsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ public function process(File $phpcsFile, $stackPtr)
$found = str_replace(["\t", "\n", "\r"], ' ', $found).'...';

if ($this->error === true) {
$error = 'Silencing errors is forbidden. Found: %s';
$error = 'Silencing errors is forbidden; found: %s';
$phpcsFile->addError($error, $stackPtr, 'Forbidden', [$found]);
} else {
$error = 'Silencing errors is discouraged. Found: %s';
$error = 'Silencing errors is discouraged; found: %s';
$phpcsFile->addWarning($error, $stackPtr, 'Discouraged', [$found]);
}

Expand Down

0 comments on commit a5377f2

Please sign in to comment.