Ability to return associative array from an activity
What was changed
Added ability to return associative array from activities with JsonEncoder.
Why?
Although @SerafimArts explains in every related issue that json has no support for hashmaps or associative arrays (and this is indisputable true), but we in PHP do have support for it.
And in case of PHP workflow, PHP activity and PHP sdk we control input, output and the type, so I say we should be able to use associative arrays.
Yes, it is json, but we will use stock json_decode to get the required associative array.
Otherwise the SDK should forbid typehint activities with the array type. It is counterintuitive: if the newActivityStub returns T and I have an array declared as a return type for a function of T I would like to get it, or get an error when I'm trying to create proxy of T
Checklist
-
Closes #117 #93 #112
-
How was this tested:
With unit test and in my worker 3. Any docs updates needed?
I read in these issues that it is documented behavior. I guess this part should be updated is this PR is accepted