Skip to content

Commit

Permalink
Merge branch refs/heads/1.10.x into 1.11.x
Browse files Browse the repository at this point in the history
  • Loading branch information
phpstan-bot committed Feb 25, 2024
2 parents aca4ac6 + d8e208e commit a7f6513
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/PhpDoc/PhpDocNodeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,11 @@ public function resolvePropertyTags(PhpDocNode $phpDocNode, NameScope $nameScope
public function resolveMethodTags(PhpDocNode $phpDocNode, NameScope $nameScope): array
{
$resolved = [];
$originalNameScope = $nameScope;

foreach (['@method', '@psalm-method', '@phpstan-method'] as $tagName) {
foreach ($phpDocNode->getMethodTagValues($tagName) as $tagValue) {
$nameScope = $originalNameScope;
$templateTags = [];

if (count($tagValue->templateTypes) > 0 && $nameScope->getClassName() !== null) {
Expand Down
2 changes: 2 additions & 0 deletions tests/PHPStan/Analyser/data/generic-method-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/**
* @method TVal doThing<TVal of mixed>(TVal $param)
* @method TVal doAnotherThing(int $param)
*/
class Test
{
Expand All @@ -20,4 +21,5 @@ function test(int $int, string $string): void

assertType('int', $test->doThing($int));
assertType('string', $test->doThing($string));
assertType(TVal::class, $test->doAnotherThing($int));
}

0 comments on commit a7f6513

Please sign in to comment.