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](https://github.com/symfony/symfony-docs/pull/10969)
This commit is contained in:
Mantis Development 2019-02-23 16:28:16 +00:00 committed by Paul Richards
parent 5b23a2b257
commit be8d14a129
No known key found for this signature in database
GPG Key ID: 29967EA449106805

View File

@ -112,7 +112,7 @@ class ReflectionExtractor implements PropertyListExtractorInterface, PropertyTyp
}
if (
$context['enable_constructor_extraction'] ?? $this->enableConstructorExtraction &&
($context['enable_constructor_extraction'] ?? $this->enableConstructorExtraction) &&
$fromConstructor = $this->extractFromConstructor($class, $property)
) {
return $fromConstructor;