fix deprecations: use fqcn

This commit is contained in:
nobohan 2018-04-13 17:25:05 +02:00
parent 654f7b4d26
commit 00bbbd32d6
3 changed files with 20 additions and 17 deletions

View File

@ -30,6 +30,7 @@ use Symfony\Bundle\TwigBundle\TwigEngine;
use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\MainBundle\Templating\TranslatableStringHelper;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
/** /**
* @author Julien Fastré <julien.fastre@champs-libres.coop> * @author Julien Fastré <julien.fastre@champs-libres.coop>
@ -122,7 +123,7 @@ class CustomFieldText extends AbstractCustomField
public function buildOptionsForm(FormBuilderInterface $builder) public function buildOptionsForm(FormBuilderInterface $builder)
{ {
return $builder return $builder
->add(self::MAX_LENGTH, 'integer', array('empty_data' => 256)) ->add(self::MAX_LENGTH, IntegerType::class, array('empty_data' => 256))
->add(self::MULTIPLE_CF_INLINE, ChoiceType::class, array( ->add(self::MULTIPLE_CF_INLINE, ChoiceType::class, array(
'choices' => array( 'choices' => array(
'Multiple boxes on the line' => '1', 'Multiple boxes on the line' => '1',

View File

@ -20,6 +20,7 @@
namespace Chill\CustomFields\Tests\Form\Extension; namespace Chill\CustomFields\Tests\Form\Extension;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
/** /**
* Test the post-text extension * Test the post-text extension
@ -46,7 +47,7 @@ class PostTextIntegerExtensionTest extends KernelTestCase
public function testCreateView() public function testCreateView()
{ {
$form = $this->formBuilder->add('test', 'integer', array( $form = $this->formBuilder->add('test', IntegerType::class, array(
'post_text' => 'my text' 'post_text' => 'my text'
))->getForm(); ))->getForm();

View File

@ -20,6 +20,7 @@
namespace Chill\CustomFields\Tests\Form\Extension; namespace Chill\CustomFields\Tests\Form\Extension;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Form\Extension\Core\Type\NumberType;
/** /**
* Test the post-text extension * Test the post-text extension
@ -46,7 +47,7 @@ class PostTextNumberExtensionTest extends KernelTestCase
public function testCreateView() public function testCreateView()
{ {
$form = $this->formBuilder->add('test', 'number', array( $form = $this->formBuilder->add('test', NumberType::class, array(
'post_text' => 'my text' 'post_text' => 'my text'
))->getForm(); ))->getForm();