Skip to content

Commit

Permalink
TestCase - pass current PhpVersion to PhpStormStubsSourceStubber's co…
Browse files Browse the repository at this point in the history
…nstructor
  • Loading branch information
ondrejmirtes committed Oct 15, 2020
1 parent 43ae839 commit 8a731f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/baseline-7.4.neon
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ parameters:
count: 1
path: ../src/Reflection/ReflectionProvider/SetterReflectionProviderProvider.php
-
message: "#^Class class@anonymous/src/Testing/TestCase\\.php\\:258 has an uninitialized property \\$reflectionProvider\\. Give it default value or assign it in the constructor\\.$#"
message: "#^Class class@anonymous/src/Testing/TestCase\\.php\\:259 has an uninitialized property \\$reflectionProvider\\. Give it default value or assign it in the constructor\\.$#"
count: 1
path: ../src/Testing/TestCase.php
3 changes: 2 additions & 1 deletion src/Testing/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use PHPStan\Parser\FunctionCallStatementFinder;
use PHPStan\Parser\Parser;
use PHPStan\Parser\PhpParserDecorator;
use PHPStan\Php\PhpVersion;
use PHPStan\PhpDoc\PhpDocInheritanceResolver;
use PHPStan\PhpDoc\PhpDocNodeResolver;
use PHPStan\PhpDoc\PhpDocStringResolver;
Expand Down Expand Up @@ -191,7 +192,7 @@ private function createReflectionProviderByParameters(
private static function getPhpStormStubsSourceStubber(): PhpStormStubsSourceStubber
{
if (self::$phpStormStubsSourceStubber === null) {
self::$phpStormStubsSourceStubber = new PhpStormStubsSourceStubber(new PhpParserDecorator(self::getContainer()->getByType(CachedParser::class)));
self::$phpStormStubsSourceStubber = new PhpStormStubsSourceStubber(new PhpParserDecorator(self::getContainer()->getByType(CachedParser::class)), self::getContainer()->getByType(PhpVersion::class)->getVersionId());
}

return self::$phpStormStubsSourceStubber;
Expand Down

0 comments on commit 8a731f7

Please sign in to comment.