php-dot-notation
php-dot-notation copied to clipboard
Array unflatten feature
I noticed there was an open issue for this: https://github.com/adbario/php-dot-notation/issues/19. I also needed this for a private project I'm working on recently. Thought I'd kill two birds with one stone and create a PR with my changes.
If you have any questions or feedback please let me know.
Coverage decreased (-0.6%) to 99.405% when pulling a9189e26c519da5c9c69cf6ba6cca728c5b19aea on DJames239:array-unflatten-feature into 3857c8cfb32b866fcc12fb9ffd1f401c431da43b on adbario:2.x.
Thanks for the PR 👍
The set method already unflattens the given array, there's currently no option to pass a key delimiter though. Also, the new method doesn't rely on anything within the Dot class, but using it requires an existing instance of the class. For these reasons, feels like a separate helper function would be a better option.
Closing as no further comments from OP.