Skip to content

Commit 018b497

Browse files
committed
Typo
1 parent 727678c commit 018b497

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

SlevomatCodingStandard/Sniffs/TypeHints/TypeHintDeclarationSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,8 @@ private function checkUselessDocComment(\PHP_CodeSniffer\Files\File $phpcsFile,
504504
continue;
505505
}
506506

507-
if (isset($matches[2])) {
508-
$parametersContainDescription[$matches[2]] = true;
507+
if (isset($matches[1])) {
508+
$parametersContainDescription[$matches[1]] = true;
509509
$containsUsefulInformation = true;
510510
} elseif (isset($parametersNames[$parameterAnnotationNo])) {
511511
$parametersContainDescription[$parametersNames[$parameterAnnotationNo]] = true;

tests/Sniffs/TypeHints/data/typeHintDeclarationEnabledEachParameterAndReturnInspectionNoErrors.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,12 @@ public function withDescription(string $param1, int $param2): void
4646
{
4747
}
4848

49+
/**
50+
* @param string|null $param2 Has description
51+
* @param string|null $param3 Has description
52+
*/
53+
public function moreParametersWithDescription(string $param1 = '', string $param2 = null, string $param3 = null): void
54+
{
55+
}
56+
4957
}

0 commit comments

Comments
 (0)