Open TobiasNx opened 4 days ago
It also seems that catmandu is not that consistend in its behaviour:
https://github.com/TobiasNx/Catmandu-Testing/tree/master/ArrayHandling
$append does not create new array with set_array
$last/$first create new arrays with given values as $append
would
*
only works it array exists
[in catmandu] $last/$first create new arrays with given values as $append would
Then we should do the same here, right?
[in catmandu] $last/$first create new arrays with given values as $append would
Then we should do the same here, right?
To be honest, I am not in favour of this even though Catmandu does this BUT it is not consitent. And Catmandu itself seems not to be consistent with this.
I prefer the behaviour that $last and $first only can do anything if the referred array exists since it is a relational statement imo.
Came up within #368 but is not part of the changes of the related pr this is current master behaviour :
While reading a path with one of the following array wildcards
$last
,$first
and*
skips the step due to no existing basis for reading, writing new values with these array wildcards does not and creates a new element/array with one of wildcard as part of the pathnamescopy_field
add_field
set_array
In my opinion these creations should be skipped due to non existing arrays and only $append/$prepend should create pathes.
This is connected to: https://github.com/metafacture/metafacture-fix/issues/161