10000 feature #17732 [DEPRECATION] : deprecated support for Traversable in … · dunglas/symfony@ff87f30 · GitHub
[go: up one dir, main page]

Skip to content

Commit ff87f30

Browse files
committed
feature symfony#17732 [DEPRECATION] : deprecated support for Traversable in method ResizeFormListener::PreSubmit (ybensacq)
This PR was squashed before being merged into the 3.1-dev branch (closes symfony#17732). Discussion ---------- [DEPRECATION] : deprecated support for Traversable in method ResizeFormListener::PreSubmit | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | symfony#17701 | License | MIT Commits ------- 68c9305 [DEPRECATION] : deprecated support for Traversable in method ResizeFormListener::PreSubmit
2 parents 0acca48 + 68c9305 commit ff87f30

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

UPGRADE-3.1.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ Form
1515

1616
* The `choices_as_values` option of the `ChoiceType` has been deprecated and
1717
will be removed in Symfony 4.0.
18+
* Support for data objects that implements both `Traversable` and `ArrayAccess`
19+
in `ResizeFormListener::preSubmit` method has been deprecated and will be
20+
removed in Symfony 4.0.
1821

1922
HttpKernel
2023
----------

UPGRADE-4.0.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Form
1313
----
1414

1515
* The `choices_as_values` option of the `ChoiceType` has been removed.
16+
* Support for data objects that implements both `Traversable` and
17+
`ArrayAccess` in `ResizeFormListener::preSubmit` method has been removed
1618

1719
HttpKernel
1820
----------

src/Symfony/Component/Form/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ CHANGELOG
55
-----
66

77
* deprecated the "choices_as_values" option of ChoiceType
8+
* deprecated support for data objects that implements both `Traversable` and
9+
`ArrayAccess` in `ResizeFormListener::preSubmit` method
810

911
3.0.0
1012
-----

src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ public function preSubmit(FormEvent $event)
102102
$form = $event->getForm();
103103
$data = $event->getData();
104104

105+
if ($data instanceof \Traversable && $data instanceof \ArrayAccess) {
106+
@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);
107+
}
108+
105109
if (!is_array($data) && !($data instanceof \Traversable && $data instanceof \ArrayAccess)) {
106110
$data = array();
107111
}

0 commit comments

Comments
 (0)
0