Skip to content

Fixes Bug During Mapping of Array Types

Choose a tag to compare

@thehappybug thehappybug released this 18 Jul 12:25
· 38 commits to master since this release

When mapping a field of array type, the PHP 7 type is too generic. The JsonMapper should have inspected the @param annotation in the Docblock comment for a hint on what the element type for the array is and used this information to map the array of complex types correctly. However, this was not happening in the case of an array OR nullable type i.e ?array PHP type-hint. Instead, an array of stdClass was being created for an array of complex types.

This release fixes this issue. Just update your JsonMapper version to receive the fix.