[Form] Deprecated ChoiceList::getIndicesFor*() methods

This commit is contained in:
Bernhard Schussek 2013-09-10 14:28:39 +02:00
parent 67ba131458
commit 9efdb8e5d0
7 changed files with 39 additions and 13 deletions

View File

@ -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

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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);
}

View File

@ -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)
{

View File

@ -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)
{