Skip to content

Commit

Permalink
moved feature to 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Apr 22, 2018
1 parent e250dfa commit 9592fa6
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 67 deletions.
34 changes: 34 additions & 0 deletions UPGRADE-4.1.md
Expand Up @@ -27,6 +27,40 @@ EventDispatcher

* The `TraceableEventDispatcherInterface` has been deprecated.

Form
----

* Deprecated the `ChoiceLoaderInterface` implementation in `CountryType`,
`LanguageType`, `LocaleType` and `CurrencyType`, use the `choice_loader`
option instead.

Before:
```php
class MyCountryType extends CountryType
{
public function loadChoiceList()
{
// override the method
}
}
```

After:
```php
class MyCountryType extends AbstractType
{
public function getParent()
{
return CountryType::class;
}

public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefault('choice_loader', ...); // override the option instead
}
}
```

FrameworkBundle
---------------

Expand Down
34 changes: 0 additions & 34 deletions UPGRADE-4.2.md

This file was deleted.

6 changes: 1 addition & 5 deletions src/Symfony/Component/Form/CHANGELOG.md
@@ -1,15 +1,11 @@
CHANGELOG
=========

4.2.0
4.1.0
-----

* added `choice_translation_locale` option to `CountryType`, `LanguageType`, `LocaleType` and `CurrencyType`
* deprecated the `ChoiceLoaderInterface` implementation in `CountryType`, `LanguageType`, `LocaleType` and `CurrencyType`

4.1.0
-----

* added `input=datetime_immutable` to DateType, TimeType, DateTimeType
* added `rounding_mode` option to MoneyType

Expand Down
14 changes: 7 additions & 7 deletions src/Symfony/Component/Form/Extension/Core/Type/CountryType.php
Expand Up @@ -30,7 +30,7 @@ class CountryType extends AbstractType implements ChoiceLoaderInterface
*
* @var ArrayChoiceList
*
* @deprecated since Symfony 4.2
* @deprecated since Symfony 4.1
*/
private $choiceList;

Expand Down Expand Up @@ -73,11 +73,11 @@ public function getBlockPrefix()
/**
* {@inheritdoc}
*
* @deprecated since Symfony 4.2
* @deprecated since Symfony 4.1
*/
public function loadChoiceList($value = null)
{
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.2, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);

if (null !== $this->choiceList) {
return $this->choiceList;
Expand All @@ -89,11 +89,11 @@ public function loadChoiceList($value = null)
/**
* {@inheritdoc}
*
* @deprecated since Symfony 4.2
* @deprecated since Symfony 4.1
*/
public function loadChoicesForValues(array $values, $value = null)
{
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.2, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);

// Optimize
$values = array_filter($values);
Expand All @@ -112,11 +112,11 @@ public function loadChoicesForValues(array $values, $value = null)
/**
* {@inheritdoc}
*
* @deprecated since Symfony 4.2
* @deprecated since Symfony 4.1
*/
public function loadValuesForChoices(array $choices, $value = null)
{
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.2, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);

// Optimize
$choices = array_filter($choices);
Expand Down
14 changes: 7 additions & 7 deletions src/Symfony/Component/Form/Extension/Core/Type/CurrencyType.php
Expand Up @@ -30,7 +30,7 @@ class CurrencyType extends AbstractType implements ChoiceLoaderInterface
*
* @var ArrayChoiceList
*
* @deprecated since Symfony 4.2
* @deprecated since Symfony 4.1
*/
private $choiceList;

Expand Down Expand Up @@ -73,11 +73,11 @@ public function getBlockPrefix()
/**
* {@inheritdoc}
*
* @deprecated since Symfony 4.2
* @deprecated since Symfony 4.1
*/
public function loadChoiceList($value = null)
{
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.2, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);

if (null !== $this->choiceList) {
return $this->choiceList;
Expand All @@ -89,11 +89,11 @@ public function loadChoiceList($value = null)
/**
* {@inheritdoc}
*
* @deprecated since Symfony 4.2
* @deprecated since Symfony 4.1
*/
public function loadChoicesForValues(array $values, $value = null)
{
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.2, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);

// Optimize
$values = array_filter($values);
Expand All @@ -112,11 +112,11 @@ public function loadChoicesForValues(array $values, $value = null)
/**
* {@inheritdoc}
*
* @deprecated since Symfony 4.2
* @deprecated since Symfony 4.1
*/
public function loadValuesForChoices(array $choices, $value = null)
{
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.2, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);

// Optimize
$choices = array_filter($choices);
Expand Down
14 changes: 7 additions & 7 deletions src/Symfony/Component/Form/Extension/Core/Type/LanguageType.php
Expand Up @@ -30,7 +30,7 @@ class LanguageType extends AbstractType implements ChoiceLoaderInterface
*
* @var ArrayChoiceList
*
* @deprecated since Symfony 4.2
* @deprecated since Symfony 4.1
*/
private $choiceList;

Expand Down Expand Up @@ -73,11 +73,11 @@ public function getBlockPrefix()
/**
* {@inheritdoc}
*
* @deprecated since Symfony 4.2
* @deprecated since Symfony 4.1
*/
public function loadChoiceList($value = null)
{
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.2, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);

if (null !== $this->choiceList) {
return $this->choiceList;
Expand All @@ -89,11 +89,11 @@ public function loadChoiceList($value = null)
/**
* {@inheritdoc}
*
* @deprecated since Symfony 4.2
* @deprecated since Symfony 4.1
*/
public function loadChoicesForValues(array $values, $value = null)
{
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.2, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);

// Optimize
$values = array_filter($values);
Expand All @@ -112,11 +112,11 @@ public function loadChoicesForValues(array $values, $value = null)
/**
* {@inheritdoc}
*
* @deprecated since Symfony 4.2
* @deprecated since Symfony 4.1
*/
public function loadValuesForChoices(array $choices, $value = null)
{
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.2, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);

// Optimize
$choices = array_filter($choices);
Expand Down
14 changes: 7 additions & 7 deletions src/Symfony/Component/Form/Extension/Core/Type/LocaleType.php
Expand Up @@ -30,7 +30,7 @@ class LocaleType extends AbstractType implements ChoiceLoaderInterface
*
* @var ArrayChoiceList
*
* @deprecated since Symfony 4.2
* @deprecated since Symfony 4.1
*/
private $choiceList;

Expand Down Expand Up @@ -73,11 +73,11 @@ public function getBlockPrefix()
/**
* {@inheritdoc}
*
* @deprecated since Symfony 4.2
* @deprecated since Symfony 4.1
*/
public function loadChoiceList($value = null)
{
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.2, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);

if (null !== $this->choiceList) {
return $this->choiceList;
Expand All @@ -89,11 +89,11 @@ public function loadChoiceList($value = null)
/**
* {@inheritdoc}
*
* @deprecated since Symfony 4.2
* @deprecated since Symfony 4.1
*/
public function loadChoicesForValues(array $values, $value = null)
{
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.2, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);

// Optimize
$values = array_filter($values);
Expand All @@ -112,11 +112,11 @@ public function loadChoicesForValues(array $values, $value = null)
/**
* {@inheritdoc}
*
* @deprecated since Symfony 4.2
* @deprecated since Symfony 4.1
*/
public function loadValuesForChoices(array $choices, $value = null)
{
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.2, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('Method "%s" is deprecated since Symfony 4.1, use "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);

// Optimize
$choices = array_filter($choices);
Expand Down

0 comments on commit 9592fa6

Please sign in to comment.