You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$composerData = json_decode(file_get_contents('composer.json'));
$data = newDot($composerData);
// old way, still worksforeach ($data['config']['allow-plugins'] as$plugin) {}
// with dotforeach ($data['config.allow-plugins'] as$plugin) {}
It feels like JsonPath is pretty close to offering this. Perhaps there could be a way to implement an ArrayAccess interface so that
$jsonPath = ... (get the jsonpath object from a json string or an existing object/array).$jsonPath['home.owner.name.first'].
Of course, at this point it's not a JsonPath, so maybe a new component could be introduce.
A bit of brainstorming here, I'm still wrapping my head around all the cool features related to DTO, and wanted to bring this up as a way to access nested values.
The text was updated successfully, but these errors were encountered:
Description
I like the new JSON Path component.
But when I already have an object, I sometime want an easy way to access the elements. I've been using https://packagist.org/packages/adbario/php-dot-notation but there are other that provide the same functionality.
Example
It feels like JsonPath is pretty close to offering this. Perhaps there could be a way to implement an ArrayAccess interface so that
Of course, at this point it's not a JsonPath, so maybe a new component could be introduce.
A bit of brainstorming here, I'm still wrapping my head around all the cool features related to DTO, and wanted to bring this up as a way to access nested values.
The text was updated successfully, but these errors were encountered: