Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 47993a8

Browse files
committed
[Form] Remove deprecated ChoiceLoaderInterface implementation in TimezoneType
1 parent 1400526 commit 47993a8

File tree

2 files changed

+2
-76
lines changed

2 files changed

+2
-76
lines changed

src/Symfony/Component/Form/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ CHANGELOG
1818
* removed passing a `ValueExporter` instance to the `FormDataExtractor::__construct()` method
1919
* removed passing guesser services ids as the fourth argument of `DependencyInjectionExtension::__construct()`
2020
* removed the ability to validate an unsubmitted form.
21+
* removed `ChoiceLoaderInterface` implementation in `TimezoneType`
2122

2223
3.4.0
2324
-----

src/Symfony/Component/Form/Extension/Core/Type/TimezoneType.php

Lines changed: 1 addition & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,14 @@
1212
namespace Symfony\Component\Form\Extension\Core\Type;
1313

1414
use Symfony\Component\Form\AbstractType;
15-
use Symfony\Component\Form\ChoiceList\ArrayChoiceList;
1615
use Symfony\Component\Form\ChoiceList\Loader\CallbackChoiceLoader;
17-
use Symfony\Component\Form\ChoiceList\Loader\ChoiceLoaderInterface;
1816
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeZoneToStringTransformer;
1917
use Symfony\Component\Form\FormBuilderInterface;
2018
use Symfony\Component\OptionsResolver\Options;
2119
use Symfony\Component\OptionsResolver\OptionsResolver;
2220

23-
class TimezoneType extends AbstractType implements ChoiceLoaderInterface
21+
class TimezoneType extends AbstractType
2422
{
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-
3623
/**
3724
* {@inheritdoc}
3825
*/
@@ -82,68 +69,6 @@ public function getBlockPrefix()
8269
return 'timezone';
8370
}
8471

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-
14772
/**
14873
* Returns a normalized array of timezone choices.
14974
*

0 commit comments

Comments
 (0)