8000 [Form] Restored BC in AbstractType::getDefaultOptions() and getAllowe… · gedrox/symfony@eccc5bd · GitHub
[go: up one dir, main page]

Skip to content

Commit eccc5bd

Browse files
committed
[Form] Restored BC in AbstractType::getDefaultOptions() and getAllowedOptionValues()
1 parent 1be155a commit eccc5bd

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/Symfony/Component/Form/AbstractType.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,32 +52,36 @@ public function finishView(FormView $view, FormInterface $form, array $options)
5252
*/
5353
public function setDefaultOptions(OptionsResolverInterface $resolver)
5454
{
55-
$resolver->setDefaults($this->getDefaultOptions());
56-
$resolver->addAllowedValues($this->getAllowedOptionValues());
55+
$resolver->setDefaults($this->getDefaultOptions(array()));
56+
$resolver->addAllowedValues($this->getAllowedOptionValues(array()));
5757
}
5858

5959
/**
6060
* Returns the default options for this type.
6161
*
62+
* @param array $options Unsupported as of Symfony 2.1.
63+
*
6264
* @return array The default options
6365
*
6466
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
6567
* Use {@link setDefaultOptions()} instead.
6668
*/
67-
public function getDefaultOptions()
69+
public function getDefaultOptions(array $options)
6870
{
6971
return array();
7072
}
7173

7274
/**
7375
* Returns the allowed option values for each option (if any).
7476
*
77+
* @param array $options Unsupported as of Symfony 2.1.
78+
*
7579
* @return array The allowed option values
7680
*
7781
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
7882
* Use {@link setDefaultOptions()} instead.
7983
*/
80-
public function getAllowedOptionValues()
84+
public function getAllowedOptionValues(array $options)
8185
{
8286
return array();
8387
}

src/Symfony/Component/Form/CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ CHANGELOG
106106
* removed superfluous methods from DataMapperInterface
107107
* `mapFormToData`
108108
* `mapDataToForm`
109-
* [BC BREAK] FormType::getDefaultOptions() and FormType::getAllowedOptionValues()
110-
don't receive an options array anymore.
111109
* added `setDefaultOptions` to FormTypeInterface and FormTypeExtensionInterface
112110
which accepts an OptionsResolverInterface instance
113111
* deprecated the methods `getDefaultOptions` and `getAllowedOptionValues`

0 commit comments

Comments
 (0)
0