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

[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
Prev Previous commit
Next Next commit
[DEPRECATION] : deprecated support for Traversable in method
  • Loading branch information
ybensacq committed Feb 8, 2016
commit 39f7f548294d011b5e874af6063bb417f7b8d4b7
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ public function preSubmit(FormEvent $event)
$form = $event->getForm();
$data = $event->getData();


if ($data instanceof \Traversable){
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing space before the curly brace and IMO this should be $data instanceof \Traversable && $data instanceof \ArrayAccess because if someone pass an object that implements Traversable but not ArrayAccess the deprecation will be thrown but the $data will be reseted to an empty array.

@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);
Copy link
Contributor

Choose a reason for hiding this comment

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

It may be OK for data init as array, but an object implementing only \Traversable would trigger the notice but was not supported before unless supporting \ArrayAccess too.

What about 'Support for objects implementing both \Traversable and \ArrayAccess is deprecated since version 3.1 and will be removed in 4.0. You should not use it anymore.' ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would say: Use an array instead. instead of You should not use it anymore..

}
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.