Added support for Link and Array ContentTypes in src/DynamicEntry#43
Added support for Link and Array ContentTypes in src/DynamicEntry#43lesleydesmet wants to merge 1 commit intousemarkup:masterfrom
Conversation
|
@lesleydesmet Thanks for this PR! Would it be possible to add to the unit test against this class to cover the cases being added here? It'll help be clearer about what the change is doing, and whether it is successful. |
| private function formatArray($array) | ||
| { | ||
| if (count($array) == 1) { | ||
| return array_first($array); |
There was a problem hiding this comment.
Why not using the return $array[0] directly?
There was a problem hiding this comment.
That's a good point - array_first seems to be a helper function from Laravel, rather than being in the PHP standard library.
return array_values($array)[0];would usually be better.
|
Hi @lesleydesmet - I'd really like to include this change if you still feel it's useful. It would be good to have a unit test here - let me know if you need any assistance! Also, as per the comment above, the function |
|
To be clear - this PR is not mergeable in its current state, given the use of the |
Sometimes the raw data is still an object so the function "getCoarcedfield" has to return the fields.