-
Notifications
You must be signed in to change notification settings - Fork 50
enable autowiring for every discoverable service #174
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. FYI: This is one of the oldest classes you are removing now. =)
Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, just one question about service names
Resources/config/services.xml
Outdated
<service id="httplug.uri_factory.default" class="Http\Message\UriFactory"> | ||
<factory class="Http\Discovery\UriFactoryDiscovery" method="find" /> | ||
</service> | ||
<service id="Http\Message\UriFactory" alias="httplug.uri_factory.default" public="false" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the symfony 4 way of doing this to still have the old-style service name plus the name that is the interface name? that is, should this be public and we deprecate the old-style service and remove it in the next major version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm 200% with this idea, but I think we have a lot of work around all those services. The main issue is probably the ability to override any service with the dependency injection container. I don't know if BC will be kept if we invert the real definition and the alias as a user may replace the old-style name by a definition (instead of an alias) and so break the equity between new-style = old-style. But can this be considered as a BC break?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we want to remove httplug.uri_factory.default in the next major version we should make the alias public instead of private so that users can be forward compatible. but i am not sure what the intention of symfony itself is on that question... so lets merge this as is and try to find out what to do for the future.
Before merging, I will map FQCN aliases to |
This continues the work done in #142. By declaring an alias for every service.
This also remove the
DiscoveryPass
in favor of plain xml configuration as I think the provided configuration is equivalent to the compiler pass but easier to maintain.