12
12
namespace Symfony \Component \Form \Extension \Core \Type ;
13
13
14
14
use Symfony \Component \Form \AbstractType ;
15
- use Symfony \Component \Form \ChoiceList \ArrayChoiceList ;
16
15
use Symfony \Component \Form \ChoiceList \Loader \CallbackChoiceLoader ;
17
- use Symfony \Component \Form \ChoiceList \Loader \ChoiceLoaderInterface ;
18
16
use Symfony \Component \Form \Extension \Core \DataTransformer \DateTimeZoneToStringTransformer ;
19
17
use Symfony \Component \Form \FormBuilderInterface ;
20
18
use Symfony \Component \OptionsResolver \Options ;
21
19
use Symfony \Component \OptionsResolver \OptionsResolver ;
22
20
23
- class TimezoneType extends AbstractType implements ChoiceLoaderInterface
21
+ class TimezoneType extends AbstractType
24
22
{
25
- /**
26
- * Timezone loaded choice list.
27
- *
28
- * The choices are generated from the ICU function \DateTimeZone::listIdentifiers().
29
- *
30
- * @var ArrayChoiceList
31
- *
32
- * @deprecated since version 3.4, to be removed in 4.0
33
- */
34
- private $ choiceList ;
35
-
36
23
/**
37
24
* {@inheritdoc}
38
25
*/
@@ -82,68 +69,6 @@ public function getBlockPrefix()
82
69
return 'timezone ' ;
83
70
}
84
71
85
- /**
86
- * {@inheritdoc}
87
- *
88
- * @deprecated since version 3.4, to be removed in 4.0
89
- */
90
- public function loadChoiceList ($ value = null )
91
- {
92
- @trigger_error (sprintf ('Method "%s" is deprecated since version 3.4 and will be removed in 4.0. ' , __METHOD__ ), E_USER_DEPRECATED );
93
-
94
- if (null !== $ this ->choiceList ) {
95
- return $ this ->choiceList ;
96
- }
97
-
98
- return $ this ->choiceList = new ArrayChoiceList (self ::getTimezones (\DateTimeZone::ALL ), $ value );
99
- }
100
-
101
- /**
102
- * {@inheritdoc}
103
- *
104
- * @deprecated since version 3.4, to be removed in 4.0
105
- */
106
- public function loadChoicesForValues (array $ values , $ value = null )
107
- {
108
- @trigger_error (sprintf ('Method "%s" is deprecated since version 3.4 and will be removed in 4.0. ' , __METHOD__ ), E_USER_DEPRECATED );
109
-
110
- // Optimize
111
- $ values = array_filter ($ values );
112
- if (empty ($ values )) {
113
- return array ();
114
- }
115
-
116
- // If no callable is set, values are the same as choices
117
- if (null === $ value ) {
118
- return $ values ;
119
- }
120
-
121
- return $ this ->loadChoiceList ($ value )->getChoicesForValues ($ values );
122
- }
123
-
124
- /**
125
- * {@inheritdoc}
126
- *
127
- * @deprecated since version 3.4, to be removed in 4.0
128
- */
129
- public function loadValuesForChoices (array $ choices , $ value = null )
130
- {
131
- @trigger_error (sprintf ('Method "%s" is deprecated since version 3.4 and will be removed in 4.0. ' , __METHOD__ ), E_USER_DEPRECATED );
132
-
133
- // Optimize
134
- $ choices = array_filter ($ choices );
135
- if (empty ($ choices )) {
136
- return array ();
137
- }
138
-
139
- // If no callable is set, choices are the same as values
140
- if (null === $ value ) {
141
- return $ choices ;
142
- }
143
-
144
- return $ this ->loadChoiceList ($ value )->getValuesForChoices ($ choices );
145
- }
146
-
147
72
/**
148
73
* Returns a normalized array of timezone choices.
149
74
*
0 commit comments