phpstan-symfony
phpstan-symfony copied to clipboard
Missing null in InputBag::all() return type
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()
$request->request never comes from JSON in Symfony.
Parsing a JSON payload is only done in Request::getPayload()