sdk-php icon indicating copy to clipboard operation
sdk-php copied to clipboard

Support nullable array types, `?array`

Open roquie opened this issue 3 years ago • 2 comments
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 avatar Sep 23 '22 10:09 roquie

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Sep 23 '22 10:09 CLAassistant

@roquie thank you for PR 💪 Maybe you can add a simple test for it?

seregazhuk avatar Sep 24 '22 05:09 seregazhuk

@roquie Thank you for the PR. One small note, every PR should contain tests if possible. Could you please add them?

rustatian avatar Oct 21 '22 18:10 rustatian