Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9fffd39

Browse files
committed
[DEPRECATION] : deprecated support for Traversable in method
1 parent 80f3410 commit 9fffd39

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Symfony/Component/Form/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
-----
66

77
* deprecated the "choices_as_values" option of ChoiceType
8+
* deprecated support for Traversable in `ResizeFormListener::PreSubmit` method
89

910
3.0.0
1011
-----

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

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

105+
106+
if ($data instanceof \Traversable){
107+
@trigger_error('Support for Traversable is deprecated since version 3.1 and will be removed in 4.0. You should not use it anymore.', E_USER_DEPRECATED);
108+
}
109+
105110
if (null === $data || '' === $data) {
106111
$data = array();
107112
}
108113

109-
if (!is_array($data) && !($data instanceof \Traversable && $data instanceof \ArrayAccess)) {
114+
if (!is_array($data) && !$data instanceof \ArrayAccess) {
110115
$data = array();
111116
}
112117

0 commit comments

Comments
 (0)