Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reproduce the Arrayzy api inside Manager #37

Closed
electricjones opened this issue Nov 3, 2015 · 2 comments
Closed

Reproduce the Arrayzy api inside Manager #37

electricjones opened this issue Nov 3, 2015 · 2 comments
Milestone

Comments

@electricjones
Copy link
Owner

It is currently possible to retrieve collections when using the CollectionTrait, but it would be nice to use the api (at least some of it) directly inside manager to modify the values in the container.

$manager->set(['one' => ['two' => ['a', 'b']]]);
$manager->walk('one.two', function(){});

// or
$manger->one->two->walk(function(){});

Not sure the best api to use, but it should be simple enough to use Arrayzy to do the actual work and just have methods in CollectionTrait pass along to the external dependency.

@electricjones electricjones mentioned this issue Nov 3, 2015
12 tasks
@electricjones electricjones changed the title Reproduce the Arrayzy api *inside* Manager Reproduce the Arrayzy api inside Manager Nov 3, 2015
@electricjones electricjones added this to the v0.8.7 milestone Nov 3, 2015
@electricjones
Copy link
Owner Author

Commit f7619d8 begins this process.

The question is, how to handle the returns? As of now, any call to any Collection Method is passed to an ArrayImitator instance and the result of that (an ArrayImitator) is returned with a simple toArray() method.

Should an array be returned instead?

Should these methods modify the manager manifest? An optional argument to do so?

Should there be any notion of method chaining while using these? If so, how do you know which to return?

Just thinking out loud 😸

@electricjones
Copy link
Owner Author

I've added flagging so the user can choose how the api affects/returns.

All that is left it:

  • add the rest of the Arrayzy API
  • create a better exception
  • figure out how to handle collisions with ChainsNestableItemsTrait

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant