Skip to content

Commit 36e48a5

Browse files
authored
Merge pull request #37 from adrienbrault/patch-1
Fix return type error message
2 parents 81bb234 + b06e2d1 commit 36e48a5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Rules/TypeHints/AbstractMissingTypeHintRule.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ private function analyzeWithTypehint(DebugContextInterface $debugContext, Type $
180180
if ($debugContext instanceof ParameterDebugContext) {
181181
return sprintf('%s type is "array". Please provide a @param annotation to further specify the type of the array. For instance: @param int[] $%s', (string) $debugContext, $debugContext->getName());
182182
} else {
183-
return sprintf('%s return type is "array". Please provide a @param annotation to further specify the type of the array. For instance: @return int[]', (string) $debugContext);
183+
return sprintf('%s return type is "array". Please provide a @return annotation to further specify the type of the array. For instance: @return int[]', (string) $debugContext);
184184
}
185185
} else {
186186
if ($docblockWithoutNullable instanceof UnionType) {

tests/Rules/TypeHints/MissingTypeHintRuleInFunctionTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testCheckCatchedException()
5555
38,
5656
],
5757
[
58-
'In function "test6", return type is "array". Please provide a @param annotation to further specify the type of the array. For instance: @return int[]',
58+
'In function "test6", return type is "array". Please provide a @return annotation to further specify the type of the array. For instance: @return int[]',
5959
38,
6060
],
6161
[

0 commit comments

Comments
 (0)