From e791e8a563e74e9eeebd23f6efbb964e79285e3d Mon Sep 17 00:00:00 2001 From: Guilliam Xavier Date: Wed, 31 Mar 2021 16:22:15 +0200 Subject: [PATCH] Do not overwrite variable with unknown value --- .../Property/Restriction/PropertySchemaChoiceRestriction.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bridge/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaChoiceRestriction.php b/src/Bridge/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaChoiceRestriction.php index c12630177a5..712517df7f7 100644 --- a/src/Bridge/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaChoiceRestriction.php +++ b/src/Bridge/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaChoiceRestriction.php @@ -32,8 +32,8 @@ public function create(Constraint $constraint, PropertyMetadata $propertyMetadat { $choices = []; - if (\is_callable($choices = $constraint->callback)) { - $choices = $choices(); + if (\is_callable($constraint->callback)) { + $choices = ($constraint->callback)(); } elseif (\is_array($constraint->choices)) { $choices = $constraint->choices; }