[DEPRECATION] : deprecated support for Traversable in method ResizeFormListener::PreSubmit

This commit is contained in:
Yannick 2016-02-08 22:05:30 +01:00 committed by Fabien Potencier
parent 80f3410da9
commit 68c93057fb
4 changed files with 11 additions and 0 deletions

View File

@ -15,6 +15,9 @@ Form
* The `choices_as_values` option of the `ChoiceType` has been deprecated and
will be removed in Symfony 4.0.
* Support for data objects that implements both `\Traversable` and `\ArrayAccess`
in `ResizeFormListener::preSubmit` method has been deprecated and will be
removed in Symfony 4.0.
HttpKernel
----------

View File

@ -13,6 +13,8 @@ Form
----
* The `choices_as_values` option of the `ChoiceType` has been removed.
* Support for data objects that implements both `\Traversable` and
`\ArrayAccess` in `ResizeFormListener::preSubmit` method has been removed
Serializer
----------

View File

@ -5,6 +5,8 @@ CHANGELOG
-----
* deprecated the "choices_as_values" option of ChoiceType
* deprecated support for data objects that implements both `\Traversable` and
`\ArrayAccess` in `ResizeFormListener::preSubmit` method
3.0.0
-----

View File

@ -102,6 +102,10 @@ class ResizeFormListener implements EventSubscriberInterface
$form = $event->getForm();
$data = $event->getData();
if ($data instanceof \Traversable && $data instanceof \ArrayAccess) {
@trigger_error('Support for objects implementing both \Traversable and \ArrayAccess is deprecated since version 3.1 and will be removed in 4.0. Use an array instead.', E_USER_DEPRECATED);
}
if (null === $data || '' === $data) {
$data = array();
}