8000 [DEPRECATION] : deprecated support for Traversable in method ResizeFormListener::PreSubmit by ybensacq · Pull Request #17732 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions UPGRADE-3.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand Down
2 changes: 2 additions & 0 deletions UPGRADE-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/Form/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, you cannot remove this check because would be a BC break, you only need to add the deprecation.

$data = array();
}
Expand Down
0