Skip to content

Commit b20b6e0

Browse files
committed
Update types to use type class instead of string
1 parent 4c41d6a commit b20b6e0

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

Form/Type/AddressMapType.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace Addressable\Bundle\Form\Type;
44

55
use Symfony\Component\Form\AbstractType;
6+
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
7+
use Symfony\Component\Form\Extension\Core\Type\TextType;
68
use Symfony\Component\Form\FormBuilderInterface;
79
use Symfony\Component\Form\FormView;
810
use Symfony\Component\Form\FormInterface;
@@ -72,49 +74,49 @@ public function configureOptions(OptionsResolver $resolver)
7274
'include_current_position_action' => true, // whether to include the current position button
7375
'street_number_field' => array(
7476
'name' => 'streetNumber',
75-
'type' => 'text',
77+
'type' => TextType::class,
7678
'options' => array(
7779
'required' => true
7880
)
7981
),
8082
'street_name_field' => array(
8183
'name' => 'streetName',
82-
'type' => 'text',
84+
'type' => TextType::class,
8385
'options' => array(
8486
'required' => true
8587
)
8688
),
8789
'city_field' => array(
8890
'name' => 'city',
89-
'type' => 'text',
91+
'type' => TextType::class,
9092
'options' => array(
9193
'required' => true
9294
)
9395
),
9496
'zipcode_field' => array(
9597
'name' => 'zipCode',
96-
'type' => 'text',
98+
'type' => TextType::class,
9799
'options' => array(
98100
'required' => true
99101
)
100102
),
101103
'country_field' => array(
102104
'name' => 'country',
103-
'type' => 'text',
105+
'type' => TextType::class,
104106
'options' => array(
105107
'required' => true
106108
)
107109
),
108110
'latitude_field' => array(
109111
'name' => 'latitude',
110-
'type' => 'hidden',
112+
'type' => HiddenType::class,
111113
'options' => array(
112114
'required' => false
113115
)
114116
),
115117
'longitude_field' => array(
116118
'name' => 'longitude',
117-
'type' => 'hidden',
119+
'type' => HiddenType::class,
118120
'options' => array(
119121
'required' => false
120122
)

0 commit comments

Comments
 (0)