Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1624aa6

Browse filesBrowse files
committed
feature #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 #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 | #17701 | License | MIT Commits ------- 68c9305 [DEPRECATION] : deprecated support for Traversable in method ResizeFormListener::PreSubmit
2 parents d168529 + 2243709 commit 1624aa6
Copy full SHA for 1624aa6

File tree

Expand file treeCollapse file tree

2 files changed

+6
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-0
lines changed

‎CHANGELOG.md

Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines 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
-----

‎Extension/Core/EventListener/ResizeFormListener.php

Copy file name to clipboardExpand all lines: Extension/Core/EventListener/ResizeFormListener.php
+4Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.