Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 83ab05c

Browse files
committed
late nameScope creation
1 parent de14980 commit 83ab05c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Symfony/Component/PropertyInfo/Extractor/PhpStanExtractor.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ public function getTypes(string $class, string $property, array $context = []):
9494
return null;
9595
}
9696

97-
$nameScope = $this->contexts[$class.$declaringClass] ??= $this->nameScopeFactory->create($class, $declaringClass);
98-
9997
switch ($source) {
10098
case self::PROPERTY:
10199
$tag = '@var';
@@ -125,6 +123,7 @@ public function getTypes(string $class, string $property, array $context = []):
125123
continue;
126124
}
127125

126+
$nameScope = $this->contexts[$class.'/'.$declaringClass] ??= $this->nameScopeFactory->create($class, $declaringClass);
128127
foreach ($this->phpStanTypeHelper->getTypes($tagDocNode->value, $nameScope) as $type) {
129128
switch ($type->getClassName()) {
130129
case 'self':

0 commit comments

Comments
 (0)