8000 Allow integer values in ChoiceType · symfony/symfony@480d18c · GitHub
[go: up one dir, main page]

Skip to content

Commit 480d18c

Browse files
committed
Allow integer values in ChoiceType
1 parent 3ddb3e4 commit 480d18c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
171171
}
172172

173173
foreach ($data as $v) {
174-
if (null !== $v && !is_string($v)) {
174+
if (null !== $v && !is_string($v) && !is_int($v)) {
175175
throw new TransformationFailedException('All choices submitted must be NULL or strings.');
176176
}
177177
}

0 commit comments

Comments
 (0)
0