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

Fix Serializer return type for arrays of primitives

Open yoeunes opened this issue 2 weeks ago • 1 comments

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.

yoeunes avatar Nov 23 '25 15:11 yoeunes