Skip to content

Commit bf88611

Browse files
freddenjrfnl
authored andcommitted
Squiz/FunctionComment: no longer suggest incorrect type hint
1 parent 4a3fcfa commit bf88611

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ protected function processParams(File $phpcsFile, $stackPtr, $commentStart)
463463
}
464464
}
465465

466-
if ($suggestedTypeHint !== '' && isset($realParams[$pos]) === true) {
466+
if ($suggestedTypeHint !== '' && isset($realParams[$pos]) === true && $param['var'] !== '') {
467467
$typeHint = $realParams[$pos]['type_hint'];
468468

469469
// Remove namespace prefixes when comparing.

src/Standards/Squiz/Tests/Commenting/FunctionCommentUnitTest.php

-3
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ public function getErrorList()
107107
792 => 1,
108108
794 => 1,
109109
797 => 1,
110-
801 => 1,
111110
828 => 1,
112111
840 => 1,
113112
852 => 1,
@@ -139,10 +138,8 @@ public function getErrorList()
139138
1125 => 1,
140139
1138 => 1,
141140
1139 => 1,
142-
1142 => 1,
143141
1144 => 1,
144142
1145 => 1,
145-
1148 => 1,
146143
1151 => 1,
147144
];
148145

0 commit comments

Comments
 (0)