auraphp / Aura.Di

Dependency Injection System
MIT License
349 stars 63 forks source link

Adding support for container-interop's delegate dependency lookup concept #87

Closed moufmouf closed 9 years ago

moufmouf commented 9 years ago

Hi,

I've seen that Paul added support for ContainerInterop's ContainerInterface in the Aura.DI v3. This is great news! This pull request is an attempt to add support for the "delegate lookup" feature (meta) defined in container-interop.

The purpose of this feature is to let users work with several containers that can share entries (Aura.DI can refer to entries in another container using the lazyGet method, even if the entry is not in Aura.DI.

All in all, the changes seemed quite easy to introduce in Aura.DI, you'll modified very few lines of code. Still, let me know if you think I broke things (I read the code for Aura.DI for the first time this morning).

The most difficult thing was to write unit tests. I tried to conform to the "guidelines for contributing" to the best of my abilities. I added 2 dependencies in composer.json but these are require-dev dependencies for the unit tests. Since the point of the "delegate lookup" feature is to have containers talking together, I think it makes senses to add another container in the unit tests and have Aura and the other container talk together. Let me know if this is an issue.