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; }