Skip to content

Commit 3c56362

Browse files
committed
Unable to resolve the template type - tip with a blogpost link
1 parent 1aa8ebc commit 3c56362

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/Rules/FunctionCallParametersCheck.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ static function (Type $type): bool {
319319
continue;
320320
}
321321

322-
$errors[] = RuleErrorBuilder::message(sprintf($messages[9], $name))->line($funcCall->getLine())->build();
322+
$errors[] = RuleErrorBuilder::message(sprintf($messages[9], $name))->line($funcCall->getLine())->tip('See: https://phpstan.org/blog/solving-phpstan-error-unable-to-resolve-template-type')->build();
323323
}
324324
}
325325

tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ public function testGenericFunction(): void
425425
[
426426
'Unable to resolve the template type A in call to function CallGenericFunction\f',
427427
15,
428+
'See: https://phpstan.org/blog/solving-phpstan-error-unable-to-resolve-template-type',
428429
],
429430
[
430431
'Parameter #1 $a of function CallGenericFunction\g expects DateTime, DateTimeImmutable given.',
@@ -433,6 +434,7 @@ public function testGenericFunction(): void
433434
[
434435
'Unable to resolve the template type A in call to function CallGenericFunction\g',
435436
26,
437+
'See: https://phpstan.org/blog/solving-phpstan-error-unable-to-resolve-template-type',
436438
],
437439
]);
438440
}

tests/PHPStan/Rules/Methods/CallMethodsRuleTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ public function testCallMethods(): void
463463
[
464464
'Unable to resolve the template type T in call to method Test\ClassStringWithUpperBounds::doFoo()',
465465
1490,
466+
'See: https://phpstan.org/blog/solving-phpstan-error-unable-to-resolve-template-type',
466467
],
467468
[
468469
'Parameter #1 $a of method Test\CallableWithMixedArray::doBar() expects callable(array<string>): array<string>, Closure(array): array|null given.',
@@ -732,6 +733,7 @@ public function testCallMethodsOnThisOnly(): void
732733
[
733734
'Unable to resolve the template type T in call to method Test\ClassStringWithUpperBounds::doFoo()',
734735
1490,
736+
'See: https://phpstan.org/blog/solving-phpstan-error-unable-to-resolve-template-type',
735737
],
736738
[
737739
'Parameter #1 $a of method Test\CallableWithMixedArray::doBar() expects callable(array<string>): array<string>, Closure(array): array|null given.',
@@ -1759,6 +1761,7 @@ public function testOnlyRelevantUnableToResolveTemplateType(): void
17591761
[
17601762
'Unable to resolve the template type T in call to method OnlyRelevantUnableToResolve\Foo::doBaz()',
17611763
41,
1764+
'See: https://phpstan.org/blog/solving-phpstan-error-unable-to-resolve-template-type',
17621765
],
17631766
]);
17641767
}

0 commit comments

Comments
 (0)