-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
I think it would be great to also support Objects, being able to access nested properties on a stdObject
I'm not sure how one might manage this with strict typing, maybe a different implementation for each? DotObject, DotArray or in the constructor and get() you type check and use strict typed internal code.
Say you had an object like so:
$object = (object) ['foo' => ['bar' => 'baz']];
It would be nice to have the same logic and syntax as with arrays, and be interchangeable at each level, so an array nested in an object (like in the above example), or an object nested in an array.
$dot = new Codin\Dot($object);
$dot->get() // (object) ['foo' => ['bar' => 'baz']]
$dot->get('foo') // ['bar' => 'baz']
$dot->get('foo.bar') // 'baz'
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request