Skip to content

Conversation

@matej21
Copy link
Contributor

@matej21 matej21 commented Feb 23, 2014

This prevents from autowiring generic typehints like IContainer.

example: You have some component (in my case it was visual paginator) and factory interface. You register that factory in DI container. Then you register some presenter in DI container. Because VisualPaginator has constructor from ComponentModel\Component (__construct(IContainer $parent = NULL...), nette tries to autowire presenter. And this may cause serious problems. This PR excludes Component, Container etc. from autowiring. Of course, you still can autowire all descendants which are not blacklisted. (so you cannot autowire UI\Presenter but you can autowire FooPresenter)

As a side effect, this PR shrinks down the size of generated container :)

@JanTvrdik
Copy link
Contributor

I really like the idea, not so much the actual implementation.

@matej21
Copy link
Contributor Author

matej21 commented Feb 23, 2014

@JanTvrdik: Can you be more specific?

@matej21
Copy link
Contributor Author

matej21 commented Mar 17, 2014

cc @dg

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants