Closed Steveb-p closed 1 year ago
Hi, it's impossible to receive an array from InputBag because it's guarded by a native return type: https://github.com/symfony/http-foundation/blob/e0ad0d153e1c20069250986cd9e9dd1ccebb0d66/InputBag.php#L28
Maybe it's not the case in your Symfony version but it would definitely be a problem for you in the future so you need to rethink your approach anyway :)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Hi,
We have a case where we have a method:
...and we expect to receive data using an URL containing the following query parameter:
This means that the
InputBag
would contain an array of arrays.Since
InputBag
is generic (stub here: https://github.com/phpstan/phpstan-symfony/blob/1.2.x/stubs/Symfony/Component/HttpFoundation/InputBag.stub) we of course receive an analysis error that we need to define what types of data we expect InputBag to contain. However, we cannot specify an array, since it is not declared in the allowed data types for that generic.Is there any way we could circumvent this issue, other than of course putting it into baseline? Is it maybe possible to drop the
scalar
data type completely?