-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] improved message when alias service is not found #28449
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
Should be for master, isn't it? |
Indeed. We avoid doing such changes in patch releases generally. |
rebased on |
Are the descriptor changes required? I mean: the pass will always catch this before descriptor ever hit this situation, isn't it? Would be great to reduce the complexity if possible. |
Unfortunately, the pass is not executed when the command is run. All removal passes are disabled first. |
But the commands run after the container is compiled, isn't it? |
It uses a container that is compiled without the removal passes: symfony/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php Lines 199 to 203 in 744bf0e
|
indeed, required for being able to list all available services including autowiring types |
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.
OK, tested, I get it now. Here are some comments to fine tune the console output.
src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/DependencyInjection/Compiler/ReplaceAliasByActualDefinitionPass.php
Outdated
Show resolved
Hide resolved
3e31fb5
to
7844a47
Compare
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' ```
Thank you @xabbuh. |
…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
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 asa string, but that you have to omit it when using the
alias
attribute:This commit will enhance the generated error message in cases where the
aliased service id is prefixed with the
@
character in thealias
option like this: