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

Nested autowire does not work #501

Closed
sagikazarmark opened this Issue Jun 5, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@sagikazarmark
Copy link
Contributor

sagikazarmark commented Jun 5, 2017

Not sure if it is intended/limitation, nevertheless I couldn't find any mention in the documentation (could be I didn't read it carefully).

Reproduced here: https://github.com/reproduce/php-di/tree/nested_autowire

@mnapoli

This comment has been minimized.

Copy link
Member

mnapoli commented Jun 5, 2017

Thanks for the report! Yesterday I've worked on #499 which should address exactly that.

I've tagged a new alpha release: https://github.com/PHP-DI/PHP-DI/releases/tag/6.0.0-alpha3 Could you try it out?

@sagikazarmark

This comment has been minimized.

Copy link
Contributor Author

sagikazarmark commented Jun 5, 2017

Unfortunately it's still the same. The above link contains a script reproducing the problem, the result is the same with 6.0.0-alpha3

mnapoli added a commit that referenced this issue Jun 5, 2017

@mnapoli

This comment has been minimized.

Copy link
Member

mnapoli commented Jun 5, 2017

Thanks for the test case, indeed I've managed to reproduce it in #503 and I've updated all tests to cover it properly. I'll try to look into a fix for v6 as I'd like to have all those inconsistencies covered.

@holtkamp

This comment has been minimized.

Copy link
Contributor

holtkamp commented Nov 1, 2017

@mnapoli also encountered this. Since the combination of referencing / nested dependencies and autowiring occurs often, this breaks quite some stuff.

@mnapoli

This comment has been minimized.

Copy link
Member

mnapoli commented Nov 2, 2017

@holtkamp gotcha, I was starting to consider this may be a non critical issue that could way a future version but I think I'll fix it for the 6.0 release.

To explain the problem: I can traverse all the tree of the configuration to check for nested stuff, and when using the compiled container it's not a problem because it's done once at compilation time (never done at runtime afterwards).

But that would slow down the non-compiled container… And I'd like to keep it fast if possible (no reason to slow it down). I think I will either have to find a fast solution, or accept that the non-compiled container will slow down.

@mnapoli mnapoli added the bug label Nov 2, 2017

@mnapoli mnapoli added this to the 6.0 milestone Nov 2, 2017

@mnapoli mnapoli closed this in #540 Nov 10, 2017

mnapoli added a commit that referenced this issue Nov 10, 2017

Merge pull request #540 from PHP-DI/handle-nested-definitions
Rework how nested definitions are handled (fix #501 & #487)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment