fix possible bug in restoring the original severity if ignoring parent errors
All checks were successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/code-style Pipeline was successful

This commit is contained in:
Ferdinand Kuhl 2023-02-14 12:24:55 +01:00
parent d5831242f5
commit d2e164d5e5

View file

@ -57,7 +57,7 @@ class VariableCommentSniff extends \PHP_CodeSniffer\Standards\Squiz\Sniffs\Comme
$oldSeverity = $phpcsFile->ruleset->ruleset['DigiComp.Commenting.VariableComment.Missing']['severity'] ?? null;
$phpcsFile->ruleset->ruleset['DigiComp.Commenting.VariableComment.Missing']['severity'] = 0;
parent::processMemberVar($phpcsFile, $stackPtr);
if ($oldSeverity) {
if ($oldSeverity !== null) {
$phpcsFile->ruleset->ruleset['DigiComp.Commenting.VariableComment.Missing']['severity'] = $oldSeverity;
} else {
unset($phpcsFile->ruleset->ruleset['DigiComp.Commenting.VariableComment.Missing']['severity']);