@@ -11,11 +11,11 @@ of what a bare form class looks like::
11
11
namespace Acme\DemoBundle\Form\Type;
12
12
13
13
use Symfony\Component\Form\AbstractType;
14
- use Symfony\Component\Form\FormBuilder ;
14
+ use Symfony\Component\Form\FormBuilderInterface ;
15
15
16
16
class ProductType extends AbstractType
17
17
{
18
- public function buildForm(FormBuilder $builder, array $options)
18
+ public function buildForm(FormBuilderInterface $builder, array $options)
19
19
{
20
20
$builder->add('name');
21
21
$builder->add('price');
@@ -56,13 +56,13 @@ to an Event Subscriber::
56
56
// src/Acme/DemoBundle/Form/Type/ProductType.php
57
57
namespace Acme\DemoBundle\Form\Type;
58
58
59
- use Symfony\Component\Form\AbstractType;
60
- use Symfony\Component\Form\FormBuilder ;
59
+ use Symfony\Component\Form\AbstractType
60
+ use Symfony\Component\Form\FormBuilderInterface ;
61
61
use Acme\DemoBundle\Form\EventListener\AddNameFieldSubscriber;
62
62
63
63
class ProductType extends AbstractType
64
64
{
65
- public function buildForm(FormBuilder $builder, array $options)
65
+ public function buildForm(FormBuilderInterface $builder, array $options)
66
66
{
67
67
$subscriber = new AddNameFieldSubscriber($builder->getFormFactory());
68
68
$builder->addEventSubscriber($subscriber);
@@ -128,7 +128,7 @@ might look like the following::
128
128
129
129
// check if the product object is "new"
130
130
if (!$data->getId()) {
131
- $form->add($this->factory->createNamed('text ', 'name '));
131
+ $form->add($this->factory->createNamed('name ', 'text '));
132
132
}
133
133
}
134
134
}
0 commit comments