-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
add alias to existing service not working #28413
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
Labels
Comments
I change it to this , it works now
|
When being explicit by using the services:
_defaults:
autowire: true
autoconfigure: true
public: false
App\AppBundle\Checker\PromotionCouponEligibilityChecker: ~
App\Bundle\AppBundle\Checker\Eligibility\PromotionCouponEligibilityCheckerInterface:
alias: “App\AppBundle\Checker\PromotionCouponEligibilityChecker” I close here as this is not a bug. |
fabpot
added a commit
that referenced
this issue
Sep 23, 2018
…ice is not found (xabbuh) This PR was merged into the 4.2-dev branch. Discussion ---------- [DependencyInjection] improved message when alias service is not found | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #28413 | License | MIT | Doc PR | When using the YAML config format, it can be confusing that you need to prefix the aliased service id with an `@` character when passing it as a string, but that you have to omit it when using the `alias` attribute: ```yaml foo: '@app\Foo' foo: alias: 'App\Foo' ``` This commit will enhance the generated error message in cases where the aliased service id is prefixed with the `@` character in the `alias` option like this: ```yaml foo: alias: '@app\Foo' ``` Commits ------- 280ecbc improved message when alias service is not found
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As you can see the alias and its service are at same file, but it gives a error when autowire the interface in a class constructor.
The text was updated successfully, but these errors were encountered: