diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md index 624894ffb3..a30a318599 100644 --- a/UPGRADE-3.0.md +++ b/UPGRADE-3.0.md @@ -133,7 +133,7 @@ UPGRADE FROM 2.x to 3.0 ``` * The `TypeTestCase` class was moved from the `Symfony\Component\Form\Tests\Extension\Core\Type` namespace to the `Symfony\Component\Form\Test` namespace. - + Before: ``` @@ -162,6 +162,12 @@ UPGRADE FROM 2.x to 3.0 `NumberToLocalizedStringTransformer` were renamed to `ROUND_HALF_EVEN`, `ROUND_HALF_UP` and `ROUND_HALF_DOWN`. + * The methods `ChoiceListInterface::getIndicesForChoices()` and + `ChoiceListInterface::getIndicesForValues()` were removed. No direct + replacement exists, although in most cases + `ChoiceListInterface::getChoicesForValues()` and + `ChoiceListInterface::getValuesForChoices()` should be sufficient. + ### FrameworkBundle @@ -249,7 +255,7 @@ UPGRADE FROM 2.x to 3.0 * The Locale component was removed and replaced by the Intl component. Instead of the methods in `Symfony\Component\Locale\Locale`, you should use these equivalent methods in `Symfony\Component\Intl\Intl` now: - + * `Locale::getDisplayCountries()` -> `Intl::getRegionBundle()->getCountryNames()` * `Locale::getCountries()` -> `array_keys(Intl::getRegionBundle()->getCountryNames())` * `Locale::getDisplayLanguages()` -> `Intl::getLanguageBundle()->getLanguageNames()` diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php index a4f69eefe6..228f9aad2f 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php @@ -279,6 +279,8 @@ class EntityChoiceList extends ObjectChoiceList * @return array * * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface + * + * @deprecated Deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForChoices(array $entities) { @@ -314,6 +316,8 @@ class EntityChoiceList extends ObjectChoiceList * @return array * * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface + * + * @deprecated Deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForValues(array $values) { diff --git a/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php b/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php index b10e3c2789..17fec6d7f6 100644 --- a/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php +++ b/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php @@ -252,6 +252,8 @@ class ModelChoiceList extends ObjectChoiceList * @return array * * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface + * + * @deprecated Deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForChoices(array $models) { @@ -310,6 +312,8 @@ class ModelChoiceList extends ObjectChoiceList * @return array * * @see Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface + * + * @deprecated Deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForValues(array $values) { diff --git a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php index 17ae0a3d9e..413f7c4f74 100644 --- a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php +++ b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php @@ -198,6 +198,8 @@ class ChoiceList implements ChoiceListInterface /** * {@inheritdoc} + * + * @deprecated Deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForChoices(array $choices) { @@ -222,6 +224,8 @@ class ChoiceList implements ChoiceListInterface /** * {@inheritdoc} + * + * @deprecated Deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForValues(array $values) { @@ -485,9 +489,9 @@ class ChoiceList implements ChoiceListInterface * Extension point. In this implementation, choices are guaranteed to * always maintain their type and thus can be typesafely compared. * - * @param mixed $choice The choice. + * @param mixed $choice The choice * - * @return mixed The fixed choice. + * @return mixed The fixed choice */ protected function fixChoice($choice) { @@ -495,14 +499,14 @@ class ChoiceList implements ChoiceListInterface } /** - * Fixes the data type of the given choices to avoid comparison problems. + * Fixes the data type of the given choices to avoid comparison problems. * - * @param array $choices The choices. - * - * @return array The fixed choices. - * - * @see fixChoice - */ + * @param array $choices The choices. + * + * @return array The fixed choices. + * + * @see fixChoice + */ protected function fixChoices(array $choices) { return $choices; diff --git a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceListInterface.php b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceListInterface.php index febf80ef05..0e5f9459b9 100644 --- a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceListInterface.php +++ b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceListInterface.php @@ -138,6 +138,8 @@ interface ChoiceListInterface * array are ignored * * @return array An array of indices with ascending, 0-based numeric keys + * + * @deprecated Deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForChoices(array $choices); @@ -156,6 +158,8 @@ interface ChoiceListInterface * this array are ignored * * @return array An array of indices with ascending, 0-based numeric keys + * + * @deprecated Deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForValues(array $values); } diff --git a/src/Symfony/Component/Form/Extension/Core/ChoiceList/LazyChoiceList.php b/src/Symfony/Component/Form/Extension/Core/ChoiceList/LazyChoiceList.php index 996f900cf3..23f3cccbe2 100644 --- a/src/Symfony/Component/Form/Extension/Core/ChoiceList/LazyChoiceList.php +++ b/src/Symfony/Component/Form/Extension/Core/ChoiceList/LazyChoiceList.php @@ -105,6 +105,8 @@ abstract class LazyChoiceList implements ChoiceListInterface /** * {@inheritdoc} + * + * @deprecated Deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForChoices(array $choices) { @@ -117,6 +119,8 @@ abstract class LazyChoiceList implements ChoiceListInterface /** * {@inheritdoc} + * + * @deprecated Deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForValues(array $values) { diff --git a/src/Symfony/Component/Form/Extension/Core/ChoiceList/SimpleChoiceList.php b/src/Symfony/Component/Form/Extension/Core/ChoiceList/SimpleChoiceList.php index 914dbe5fdb..e173e742c7 100644 --- a/src/Symfony/Component/Form/Extension/Core/ChoiceList/SimpleChoiceList.php +++ b/src/Symfony/Component/Form/Extension/Core/ChoiceList/SimpleChoiceList.php @@ -135,9 +135,9 @@ class SimpleChoiceList extends ChoiceList /** * Converts the choice to a valid PHP array key. * - * @param mixed $choice The choice. + * @param mixed $choice The choice * - * @return string|integer A valid PHP array key. + * @return string|integer A valid PHP array key */ protected function fixChoice($choice) {