Skip to content

Commit 56e3974

Browse files
committed
Allow integer values in ChoiceType
1 parent 6d42909 commit 56e3974

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ public function buildForm(FormBuilderInterface $builder, array $options)
171171
}
172172

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

0 commit comments

Comments
 (0)