Skip to content

Commit

Permalink
Adjust error and code for unexpected & prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
fredden committed Jun 8, 2023
1 parent 5f8c04d commit 605d788
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,11 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart)

$error .= 'actual variable name %s';

if ($code === 'ParamNameNoMatch' && $paramVarName === '&'.$realName) {
$error = 'Doc comment for parameter %s has leading &, but %s is not passed by reference';
$code = 'ParamNameUnexpectedAmpersandPrefix';
}

$phpcsFile->addError($error, $param['tag'], $code, $data);
}//end if
} else if (substr($param['var'], -4) !== ',...') {
Expand Down

0 comments on commit 605d788

Please sign in to comment.