phpstan-symfony
phpstan-symfony copied to clipboard
Fix Serializer return type for arrays of primitives
Fixes type inference for primitive scalar types (int, string, bool, float) when used with Serializer::deserialize().
Currently, the extension wraps all base types in ObjectType. This means int[] is incorrectly inferred as an array of objects named "int" rather than scalar integers, causing false positives during arithmetic operations.