[Form] Restored BC in AbstractType::getDefaultOptions() and getAllowedOptionValues()
This commit is contained in:
parent
1be155ab8c
commit
eccc5bd0c6
@ -52,19 +52,21 @@ abstract class AbstractType implements FormTypeInterface
|
||||
*/
|
||||
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
||||
{
|
||||
$resolver->setDefaults($this->getDefaultOptions());
|
||||
$resolver->addAllowedValues($this->getAllowedOptionValues());
|
||||
$resolver->setDefaults($this->getDefaultOptions(array()));
|
||||
$resolver->addAllowedValues($this->getAllowedOptionValues(array()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the default options for this type.
|
||||
*
|
||||
* @param array $options Unsupported as of Symfony 2.1.
|
||||
*
|
||||
* @return array The default options
|
||||
*
|
||||
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
|
||||
* Use {@link setDefaultOptions()} instead.
|
||||
*/
|
||||
public function getDefaultOptions()
|
||||
public function getDefaultOptions(array $options)
|
||||
{
|
||||
return array();
|
||||
}
|
||||
@ -72,12 +74,14 @@ abstract class AbstractType implements FormTypeInterface
|
||||
/**
|
||||
* Returns the allowed option values for each option (if any).
|
||||
*
|
||||
* @param array $options Unsupported as of Symfony 2.1.
|
||||
*
|
||||
* @return array The allowed option values
|
||||
*
|
||||
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
|
||||
* Use {@link setDefaultOptions()} instead.
|
||||
*/
|
||||
public function getAllowedOptionValues()
|
||||
public function getAllowedOptionValues(array $options)
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
@ -106,8 +106,6 @@ CHANGELOG
|
||||
* removed superfluous methods from DataMapperInterface
|
||||
* `mapFormToData`
|
||||
* `mapDataToForm`
|
||||
* [BC BREAK] FormType::getDefaultOptions() and FormType::getAllowedOptionValues()
|
||||
don't receive an options array anymore.
|
||||
* added `setDefaultOptions` to FormTypeInterface and FormTypeExtensionInterface
|
||||
which accepts an OptionsResolverInterface instance
|
||||
* deprecated the methods `getDefaultOptions` and `getAllowedOptionValues`
|
||||
|
Reference in New Issue
Block a user