diff --git a/UPGRADE-3.1.md b/UPGRADE-3.1.md index e4844dd62077c..dcdd7f3acc904 100644 --- a/UPGRADE-3.1.md +++ b/UPGRADE-3.1.md @@ -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 ---------- diff --git a/UPGRADE-4.0.md b/UPGRADE-4.0.md index a485e69023766..69a7d9a0ff51b 100644 --- a/UPGRADE-4.0.md +++ b/UPGRADE-4.0.md @@ -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 ---------- diff --git a/src/Symfony/Component/Form/CHANGELOG.md b/src/Symfony/Component/Form/CHANGELOG.md index 3671caab0898a..b82f644e31cdd 100644 --- a/src/Symfony/Component/Form/CHANGELOG.md +++ b/src/Symfony/Component/Form/CHANGELOG.md @@ -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 ----- diff --git a/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php b/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php index 197f556308f25..cd00cf368e8cc 100644 --- a/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php +++ b/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php @@ -102,6 +102,10 @@ public function preSubmit(FormEvent $event) $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(); } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy