Skip to content

$request->query->get() can't return array anymore #15613

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
ThomasTr opened this issue Aug 11, 2021 · 2 comments
Closed

$request->query->get() can't return array anymore #15613

ThomasTr opened this issue Aug 11, 2021 · 2 comments
Milestone

Comments

@ThomasTr
Copy link
Contributor

According to the documentation here:
https://symfony.com/doc/current/components/http_foundation.html#accessing-request-data

// the query string is '?foo[bar]=baz'

$request->query->get('foo');
// returns ['bar' => 'baz']

$request->query->get() can return arrays, but since pull request 34363 arrays are no more supported.

I would like to replace the line

$request->query->get('foo');

with

$request->query->all()['foo'];

to hint how arrays can be accessed.
If it's ok, i can prepare a pull request.

@javiereguiluz
Copy link
Member

Thomas, thanks for reporting this problem! We've prepared in #15847 a PR to fix it. Please, review if the proposed changes look OK to you. Thanks!

@ThomasTr
Copy link
Contributor Author

Hi Javier, thanks, looks totally fine to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants