sdk-php
sdk-php copied to clipboard
Support nullable array types, `?array`
trafficstars
What was changed
When developer using class as DTO with public properties to pass values to workflow with property type ?array it got an error:
InvalidArgumentException: Passed value must be a type of array, but null given in /backend/vendor/temporal/sdk/src/Internal/Marshaller/Type/ArrayType.php:64\nStack trace:\n#0 /backend/vendor/temporal/sdk/src/Internal/Marshaller/Mapper/AttributeMapper.php(195): Temporal\\Internal\\Marshaller\\Type\\ArrayType->parse(NULL, NULL)
This error has been fixed by this PR.
@roquie thank you for PR 💪 Maybe you can add a simple test for it?
@roquie Thank you for the PR. One small note, every PR should contain tests if possible. Could you please add them?