Skip to content

Commit a0c54c6

Browse files
committed
Set default value, remove superfluous comment
1 parent e448d62 commit a0c54c6

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart)
552552
// Make sure the param name is correct.
553553
if (isset($realParams[$pos]) === true) {
554554
$realName = $realParams[$pos]['name'];
555+
$paramVarName = $param['var'];
555556

556557
if ($realParams[$pos]['pass_by_reference'] === true && $param['var'][0] === '&') {
557558
// When passed by reference, the variable name in $realParams does not
@@ -562,13 +563,6 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart)
562563

563564
// This makes sure that the 'MissingParamTag' check won't throw a false positive.
564565
$foundParams[(count($foundParams) - 1)] = $paramVarName;
565-
} else {
566-
// When not passed by reference, the name should match exactly. If
567-
// there is a stray leading '&', then something has gone wrong and
568-
// either the docblock or the function / method signature needs to be
569-
// changed. We can't auto-fix this as it's not clear which of these
570-
// two is wrong.
571-
$paramVarName = $param['var'];
572566
}
573567

574568
if ($realName !== $paramVarName) {

0 commit comments

Comments
 (0)