-
Notifications
You must be signed in to change notification settings - Fork 146
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
Update service definition for autowiring #55
Update service definition for autowiring #55
Conversation
As of Symfony 3.3, autowire_types is deprecated. This adds an alias for the knpu.oauth2.registry service definition.
When attempting to autowire the client registry:
I received:
I fixed this based on the upgrade path here: https://github.com/symfony/symfony/blob/master/UPGRADE-3.3.md#dependencyinjection |
@weaverryan failure is false (hhvm) |
@@ -13,6 +13,9 @@ | |||
<argument type="service" id="service_container" /> | |||
<argument /> <!-- argument added dynamically --> | |||
</service> | |||
|
|||
<!-- Add service alias for autowiring --> | |||
<service id="KnpU\OAuth2ClientBundle\Client\ClientRegistry" alias="knpu.oauth2.registry" 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.
Shouldn't we rename knpu.oauth2.registry
to KnpU\OAuth2ClientBundle\Client\ClientRegistry
and do the reverse?
<service id="knpu.oauth2.registry" alias="KnpU\OAuth2ClientBundle\Client\ClientRegistry" public="false" />
I think this will fix the error you mentioned
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.
Per the official 3.3 UPGRADE documentation, they recommend they do it the way I have it in the PR.
<service id="annotations.reader" class="Doctrine\Common\Annotations\AnnotationReader" public="false" />
<service id="Doctrine\Common\Annotations\Reader" alias="annotations.reader" public="false" />
Thanks @brianfreytag! I've just tagged 1.10.0 :) |
Thank you @weaverryan |
As of Symfony 3.3, autowire_types is deprecated.
This adds an alias for the knpu.oauth2.registry service definition.