8000 Apply suggestions from code review · symfony/symfony@0e1786b · GitHub
[go: up one dir, main page]

Skip to content

Commit 0e1786b

Browse files
Apply suggestions from code review
Co-authored-by: Nicolas Grekas <nicolas.grekas@gmail.com>
1 parent 5791932 commit 0e1786b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -237,16 +237,16 @@ private function getDocBlockFromProperty(string $class, string $property): ?arra
237237
return null;
238238
}
239239

240-
// Type can be inside promoted property comment as `@var`
240+
// Type can be inside property docblock as `@var`
241241
$rawDocNode = $reflectionProperty->getDocComment();
242242
$phpDocNode = $rawDocNode ? $this->getPhpDocNode($rawDocNode) : null;
243243
$source = self::PROPERTY;
244244

245-
if ($phpDocNode && [] === $phpDocNode->getTagsByName('@var')) {
245+
if (!$phpDocNode?->getTagsByName('@var')) {
246246
$phpDocNode = null;
247247
}
248248

249-
// or in the constructor comment as `@param`.
249+
// or in the constructor as `@param` for promoted properties
250250
if (!$phpDocNode && $reflectionProperty->isPromoted()) {
251251
$constructor = new \ReflectionMethod($class, '__construct');
252252
$rawDocNode = $constructor->getDocComment();

0 commit comments

Comments
 (0)
0