Skip to content

$request->query->get() can return array, but PHPDoc doesn't include array #42478

@ThomasTr

Description

@ThomasTr

Symfony version(s) affected: 5.3.6

Description
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 PHPDoc in InputBag for method get() says

@return string|int|float|bool|null

Possible Solution
In my assumption it should be save to add array to the return annotation?
If so, I'm happy to prepare a pull request.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions