You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using ReflectionExtractor::getType on a property typed with ?array and an adder typed with an object incorrectly returns the type as non nullable.
This issue can lead to problems using symfony/serializer during denormalization for example, causing it to fail since the denormalizer expect the fetched type from the ReflectionExtractor to be non-nullable even when given property is properly declared as such
How to reproduce
An example using a Video class with an array of Comment class on a $comments property (phpDoc is only indicative here for clarity purposes)
Symfony version(s) affected
7.1.2
Description
Using ReflectionExtractor::getType on a property typed with
?array
and an adder typed with an object incorrectly returns the type as non nullable.This issue can lead to problems using symfony/serializer during denormalization for example, causing it to fail since the denormalizer expect the fetched type from the ReflectionExtractor to be non-nullable even when given property is properly declared as such
How to reproduce
An example using a
Video
class with an array ofComment
class on a$comments
property (phpDoc is only indicative here for clarity purposes)Practical example with Xdebug :
Possible Solution
#57708
Additional Context
No response
The text was updated successfully, but these errors were encountered: