From be8d14a1291747220b27a40a8802eff5ef8769b6 Mon Sep 17 00:00:00 2001 From: Mantis Development Date: Sat, 23 Feb 2019 16:28:16 +0000 Subject: [PATCH] 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) --- .../Component/PropertyInfo/Extractor/ReflectionExtractor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php b/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php index 0ed1e4e2af..b8df4059b4 100644 --- a/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php +++ b/src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php @@ -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;