phpstan-symfony icon indicating copy to clipboard operation
phpstan-symfony copied to clipboard

Missing null in InputBag::all() return type

Open noemi-salaun opened this issue 1 year ago • 1 comments

When the $request->request come from JSON, the resulting associative array from $request->request->all() can have keys with null values.

#[Route(path: '/my-test', methods: ['POST'])]
public function myTest(Request $request): void
{
    var_dump($request->request->all());
}
{
  "foo": "bar",
  "something": null
}
array(2) {
  ["foo"]=> string(3) "bar"
  ["something"]=> NULL
}

I think null type should be listed in InputBagDynamicReturnTypeExtension::getAllTypeFromMethodCall()

noemi-salaun avatar Mar 03 '23 13:03 noemi-salaun