Skip to content

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

Merged
merged 1 commit into from
May 30, 2017
Merged

enable autowiring for every discoverable service #174

merged 1 commit into from
May 30, 2017

Conversation

fbourigault
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets N/A
Documentation TODO
License MIT

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.

Copy link
Member

@Nyholm Nyholm left a 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.

Copy link
Collaborator

@dbu dbu left a 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

<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" />
Copy link
Collaborator

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?

Copy link
Contributor Author

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?

Copy link
Collaborator

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.

@fbourigault
Copy link
Contributor Author

Before merging, I will map FQCN aliases to main_alias when relevant. This will avoid to break #142 changes.

@fbourigault fbourigault merged commit b9eb044 into php-http:master May 30, 2017
@fbourigault fbourigault deleted the autowiring branch May 30, 2017 08:24
@fbourigault fbourigault mentioned this pull request Aug 31, 2017
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.

4 participants