Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Analyser/NodeScopeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -4298,9 +4298,10 @@ public function getPhpDocs(Scope $scope, Node\FunctionLike|Node\Stmt\Property $n
$docComment,
);
}
$methodNameForInheritance = $node->getAttribute('originalTraitMethodName') ?? $node->name->name;
$resolvedPhpDoc = $this->phpDocInheritanceResolver->resolvePhpDocForMethod(
$scope->getClassReflection(),
$node->name->name,
$methodNameForInheritance,
$currentResolvedPhpDoc,
$positionalParameterNames,
);
Expand Down
24 changes: 24 additions & 0 deletions tests/PHPStan/Analyser/nsrt/bug-9733.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php declare(strict_types = 1);

namespace Bug9733;

use function PHPStan\Testing\assertType;

abstract class Base{
/**
* @param int[] $array
*/
abstract public function test(array $array) : void;
}

trait MyTrait{
public function test(array $array) : void{
assertType('array<int>', $array);
}
}

class Concrete extends Base{
use MyTrait {
test as test2;
}
}
Loading