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

Always interpret closures as factories #487

Closed
mnapoli opened this issue May 16, 2017 · 0 comments · Fixed by #540
Closed

Always interpret closures as factories #487

mnapoli opened this issue May 16, 2017 · 0 comments · Fixed by #540
Milestone

Comments

@mnapoli
Copy link
Member

mnapoli commented May 16, 2017

When a factory is at the root of the definition array, it is automatically interpreted as a factory (DI\factory() is not necessary).

However it's not the case if the closure is in an array or an object parameter.

We could simplify the behavior and always consider a closure as a factory. If a user wants to really inject a closure, DI\value() is here for that. The behavior will at least be more consistent and simple.

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

Successfully merging a pull request may close this issue.

1 participant