flow icon indicating copy to clipboard operation
flow copied to clipboard

[Task]: Unify JsonEntry

Open norberttech opened this issue 2 months ago • 2 comments

What needs to be done?

JsonEntry is not really following our convention, and definition of it looks like this:

/**
 * @implements Entry<?array<mixed>>
 */
final class JsonEntry implements Entry

Which assumes that json is an array but it should be string.

Another problem is related to validation, which happens directly in the constructor, which is redundant (logic duplication), validation should use type_json()->validate()

norberttech avatar Nov 04 '25 20:11 norberttech

This is also partially related to https://github.com/flow-php/flow/issues/1952

norberttech avatar Nov 05 '25 10:11 norberttech

one tricky part here will be to change underlaying type in JsonEntry from private readonly ?array $value, into private readonly ?array $array - I'm not sure how this might impact performance and the current shape of data frame since also public function value() : ?array will need to change to public function value() : ?string

norberttech avatar Nov 05 '25 10:11 norberttech