8000 [PropertyInfo] Fix multi phpdoc covered promoted properties · symfony/symfony@f503e37 · GitHub
[go: up one dir, main page]

Skip to content

Commit f503e37

Browse files
committed
[PropertyInfo] Fix multi phpdoc covered promoted properties
1 parent 1605b57 commit f503e37

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,14 @@ public function getTypes(string $class, string $property, array $context = []):
9999
continue;
100100
}
101101

102+
if (
103+
$tagDocNode->value instanceof ParamTagValueNode
104+
&& null === $prefix
105+
&& $tagDocNode->value->parameterName !== '$'.$property
106+
) {
107+
continue;
108+
}
109+
102110
foreach ($this->phpStanTypeHelper->getTypes($tagDocNode->value, $nameScope) as $type) {
103111
switch ($type->getClassName()) {
104112
case 'self':
@@ -239,10 +247,6 @@ private function getDocBlockFromProperty(string $class, string $property): ?arra
239247
$phpDocNode = $this->phpDocParser->parse($tokens);
240248
$tokens->consumeTokenType(Lexer::TOKEN_END);
241249

242-
if (self::MUTATOR === $source && !$this->filterDocBlockParams($phpDocNode, $property)) {
243-
return null;
244-
}
245-
246250
return [$phpDocNode, $source, $reflectionProperty->class];
247251
}
248252

0 commit comments

Comments
 (0)
0