Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromxabbuh:issue-28413
Sep 23, 2018

Conversation

@xabbuh
Copy link
Member

QA
Branch?2.8
Bug fix?no
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#28413
LicenseMIT
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 thealias attribute:

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 thealias
option like this:

foo:alias:'@App\Foo'

linaori reacted with thumbs up emoji
@nicolas-grekas
Copy link
Member

Should be for master, isn't it?

@stof
Copy link
Member

Indeed. We avoid doing such changes in patch releases generally.

@xabbuh
Copy link
MemberAuthor

rebased onmaster, I also updated the descriptors to provide more information there too (which is what was actually reported in#28413)

@xabbuhxabbuh changed the base branch from2.8 tomasterSeptember 13, 2018 13:37
@xabbuhxabbuh modified the milestones:2.8,nextSep 13, 2018
@nicolas-grekas
Copy link
Member

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.

@xabbuh
Copy link
MemberAuthor

Unfortunately, the pass is not executed when the command is run. All removal passes are disabled first.

@nicolas-grekas
Copy link
Member

But the commands run after the container is compiled, isn't it?

@xabbuh
Copy link
MemberAuthor

It uses a container that is compiled without the removal passes:

if (!$kernel->isDebug() || !(newConfigCache($kernel->getContainer()->getParameter('debug.container.dump'),true))->isFresh()) {
$buildContainer = \Closure::bind(function () {return$this->buildContainer(); },$kernel,\get_class($kernel));
$container =$buildContainer();
$container->getCompilerPassConfig()->setRemovingPasses(array());
$container->compile();

@chalasr
Copy link
Member

indeed, required for being able to list all available services including autowiring types

Copy link
Member

@nicolas-grekasnicolas-grekas left a 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.

@xabbuhxabbuhforce-pushed theissue-28413 branch 2 times, most recently from3e31fb5 to7844a47CompareSeptember 23, 2018 07:29
When using the YAML config format, it can be confusing that you need toprefix the aliased service id with an `@` character when passing it asa string, but that you have to omit it when using the `alias` attribute:```yamlfoo: '@app\Foo'foo:    alias: 'App\Foo'```This commit will enhance the generated error message in cases where thealiased service id is prefixed with the `@` character in the `alias`option like this:```yamlfoo:    alias: '@app\Foo'```
@fabpot
Copy link
Member

Thank you@xabbuh.

@fabpotfabpot merged commit280ecbc intosymfony:masterSep 23, 2018
fabpot added a commit that referenced this pull requestSep 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 toprefix the aliased service id with an `@` character when passing it asa string, but that you have to omit it when using the `alias` attribute:```yamlfoo: '@app\Foo'foo:    alias: 'App\Foo'```This commit will enhance the generated error message in cases where thealiased service id is prefixed with the `@` character in the `alias`option like this:```yamlfoo:    alias: '@app\Foo'```Commits-------280ecbc improved message when alias service is not found
@xabbuhxabbuh deleted the issue-28413 branchSeptember 23, 2018 12:57
@nicolas-grekasnicolas-grekas modified the milestones:next,4.2Nov 1, 2018
This was referencedNov 3, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@chalasrchalasrchalasr approved these changes

@dunglasdunglasAwaiting requested review from dunglas

@lyrixxlyrixxAwaiting requested review from lyrixx

@srozesrozeAwaiting requested review from sroze

Assignees

No one assigned

Projects

None yet

Milestone

4.2

Development

Successfully merging this pull request may close these issues.

6 participants

@xabbuh@nicolas-grekas@stof@chalasr@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp