Skip to content

Commit

Permalink
StubValidator - set analysed files to correctly analysed stubbed traits
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Feb 18, 2020
1 parent 19b2028 commit 7cd1d70
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/PhpDoc/StubValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace PHPStan\PhpDoc;

use PHPStan\Analyser\FileAnalyser;
use PHPStan\Analyser\NodeScopeResolver;
use PHPStan\Broker\Broker;
use PHPStan\DependencyInjection\Container;
use PHPStan\DependencyInjection\DerivativeContainerFactory;
Expand Down Expand Up @@ -79,6 +80,10 @@ public function validate(): array
/** @var FileAnalyser $fileAnalyser */
$fileAnalyser = $container->getByType(FileAnalyser::class);

/** @var NodeScopeResolver $nodeScopeResolver */
$nodeScopeResolver = $container->getByType(NodeScopeResolver::class);
$nodeScopeResolver->setAnalysedFiles($this->stubFiles);

$errors = [];
foreach ($this->stubFiles as $stubFile) {
$tmpErrors = $fileAnalyser->analyseFile(
Expand Down

0 comments on commit 7cd1d70

Please sign in to comment.