fix deprecations: use the fqcn for choiceType

This commit is contained in:
nobohan 2018-04-04 10:29:57 +02:00
parent c4f7256236
commit 56a695e66e
6 changed files with 269 additions and 268 deletions

View File

@ -116,7 +116,7 @@ class CSVFormatter implements FormatterInterface
*/
private function appendAggregatorForm(FormBuilderInterface $builder, $nbAggregators)
{
$builder->add('order', 'choice', array(
$builder->add('order', ChoiceType::class, array(
'choices' => array_combine(
range(1, $nbAggregators),
range(1, $nbAggregators)
@ -125,7 +125,7 @@ class CSVFormatter implements FormatterInterface
'expanded' => false
));
$builder->add('position', 'choice', array(
$builder->add('position', ChoiceType::class, array(
'choices' => array(
'row' => 'r',
'column' => 'c'

View File

@ -189,7 +189,7 @@ class SpreadSheetFormatter implements FormatterInterface
*/
private function appendAggregatorForm(FormBuilderInterface $builder, $nbAggregators)
{
$builder->add('order', 'choice', array(
$builder->add('order', ChoiceType::class, array(
'choices' => array_combine(
range(1, $nbAggregators),
range(1, $nbAggregators)

View File

@ -119,7 +119,7 @@ trait AppendScopeChoiceTypeTrait
$form = $event->getForm();
$form->add(
$builder
->create($name, 'choice', array(
->create($name, ChoiceType::class, array(
'choices' => $choices,
'auto_initialize' => false
)

View File

@ -85,7 +85,7 @@ class ComposedRoleScopeType extends AbstractType
}
$builder
->add('role', 'choice', array(
->add('role', ChoiceType::class, array(
'choices' => $values,
'placeholder' => 'Choose amongst roles',
'choice_attr' => function($role) use ($rolesWithoutScopes) {

View File

@ -51,7 +51,7 @@ class PickFormatterType extends AbstractType
$choices[$formatter->getName()] = $alias;
}
$builder->add('alias', 'choice', array(
$builder->add('alias', ChoiceType::class, array(
'choices' => $choices,
'choices_as_values' => true,
'multiple' => false

View File

@ -5,6 +5,7 @@ namespace Chill\MainBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Chill\MainBundle\Form\UserPasswordType;
class UserType extends AbstractType
@ -25,7 +26,7 @@ class UserType extends AbstractType
} else {
$builder->add($builder
->create('enabled', 'choice', array(
->create('enabled', ChoiceType::class, array(
'choices' => array(
0 => 'Disabled, the user is not allowed to login',
1 => 'Enabled, the user is active'