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

LatteExtension: changed UI\TemplateFactory type to ApplicationLatte\TemplateFactory #283

Merged
merged 2 commits into from
Feb 16, 2021

Conversation

mabar
Copy link
Contributor

@mabar mabar commented Feb 16, 2021

Latte TemplateFactory have createTemplate() extended for $class parameter and more accurate return typehint, which are both frequently used. This allows TemplateFactory to be autowired by ApplicationLatte\TemplateFactory type and prevent users confusion (like here and here)

Also some hint explaining why autowiring does not work when user sees in its DIC that service of requested type is available could be super helpful, but I have no idea how complicated the implementation would be

@dg
Copy link
Member

dg commented Feb 16, 2021

So I hope it's not a BC break.

@mabar
Copy link
Contributor Author

mabar commented Feb 16, 2021

Afaik shouldn't be? Unless user has a factory set to something what cannot be used directly as a type, it should behave in BC compatible manner.

@dg
Copy link
Member

dg commented Feb 16, 2021

https://xkcd.com/1172/

@dg dg changed the title Change TemplateFactory type to ApplicationLatte\TemplateFactory LatteExtension: changed UI\TemplateFactory type to ApplicationLatte\TemplateFactory Feb 16, 2021
@dg dg merged commit ee2835b into nette:master Feb 16, 2021
@mabar mabar deleted the patch-2 branch February 16, 2021 19:52
dg pushed a commit that referenced this pull request Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants