mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-03-12 10:36:09 +03:00
Fix Assert\Choice when choices are object not array
This commit is contained in:
parent
eb99b32151
commit
82aa08e5ff
@ -67,7 +67,8 @@ class SymfonyConstraintAnnotationReader
|
||||
$property->setMinItems($annotation->min);
|
||||
$property->setMaxItems($annotation->max);
|
||||
} elseif ($annotation instanceof Assert\Choice) {
|
||||
$property->setEnum($annotation->callback ? call_user_func(is_array($annotation->callback) ? $annotation->callback : [$reflectionProperty->class, $annotation->callback]) : $annotation->choices);
|
||||
$values = $annotation->callback ? call_user_func(is_array($annotation->callback) ? $annotation->callback : [$reflectionProperty->class, $annotation->callback]) : $annotation->choices;
|
||||
$property->setEnum(array_values($values));
|
||||
} elseif ($annotation instanceof Assert\Expression) {
|
||||
$this->appendPattern($property, $annotation->message);
|
||||
} elseif ($annotation instanceof Assert\Range) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user