8000 Fix undefined variable fromConstructor when passing context to getTypes · symfony/symfony@be8d14a · GitHub
[go: up one dir, main page]

Skip to content

Commit be8d14a

Browse files
committed
Fix undefined variable fromConstructor when passing context to getTypes
If passing context to getTypes, it checks value of $context['enable_constructor_extraction'] for true/false or the constructor value of enableConstructorExtraction and should then populate fromConstructor if necessary. The missing brackets around the first part of this check mean that fromConstructor is only applied if context is not set. This fixes the issuse described at [symfony/symfony-docs#10969](symfony/symfony-docs#10969)
1 parent 5b23a2b commit be8d14a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function getTypes($class, $property, array $context = [])
112112
}
113113

114114
if (
115-
$context['enable_constructor_extraction'] ?? $this->enableConstructorExtraction &&
115+
($context['enable_constructor_extraction'] ?? $this->enableConstructorExtraction) &&
116116
$fromConstructor = $this->extractFromConstructor($class, $property)
117117
) {
118118
return $fromConstructor;

0 commit comments

Comments
 (0)
0