Skip to content

Commit ae2b81e

Browse files
committed
UselessFunctionDocCommentSniff: Fixed internal error
1 parent 6808bca commit ae2b81e

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

SlevomatCodingStandard/Helpers/AnnotationHelper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,10 @@ public static function isAnnotationUseless(
365365
array $traversableTypeHints
366366
): bool
367367
{
368+
if ($annotation->isInvalid()) {
369+
return false;
370+
}
371+
368372
if ($typeHint === null || $annotation->getContent() === null) {
369373
return false;
370374
}

tests/Sniffs/Commenting/data/uselessFunctionDocCommentSniffNoErrors.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,13 @@ public function wrongParameterNameInAnnotation(int $a): bool
176176
return true;
177177
}
178178

179+
/**
180+
* @param [] $a
181+
* @return []
182+
*/
183+
public function invalidAnnotation(array $a): array
184+
{
185+
return [];
186+
}
187+
179188
}

0 commit comments

Comments
 (0)