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

[DI] Fix autowire error for inlined services#22857

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

Closed

Conversation

@weaverryan
Copy link
Member

QA
Branch?3.3
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#22848
LicenseMIT
Doc PRn/a

TheAutowirePass defers autowiring exceptions until later so that we don't throw autowiring exceptions for services that are ultimately removed. But, if a service isinlined, then it appears to be removed, and so we don't throw the exception. This fixes that.

It's an easy fix - but it's a bit ugly. We're adding a bit more "state" to the passes... simply because there is some information that needs to be shared through the compiler process. There might be a better way of doing this in the future (e.g. storing some metadata on theCompiler), but thisdoes work well.

newRemoveUnusedDefinitionsPass(),
)),
newAutowireExceptionPass($autowirePass),
newAutowireExceptionPass($autowirePass,$inlinedServicePass),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

perhaps pass$inlinedServicePass->getInlinedServiceIds() directly?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'd love to, but the passes haven't run yet at this point

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

the pass did not run yet so this would just return an empty array

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

aargh.. right :)

* Returns an array of all services inlined by this pass.
*
* @return array Service id strings
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@internal?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't think so

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.

👍 (after fabbot fix)

@weaverryanweaverryanforce-pushed thefix-autowire-inlined-error branch from3020bde toaeb38f6CompareMay 22, 2017 15:19
@nicolas-grekas
Copy link
Member

Thank you@weaverryan.

nicolas-grekas added a commit that referenced this pull requestMay 23, 2017
This PR was squashed before being merged into the 3.3 branch (closes#22857).Discussion----------[DI] Fix autowire error for inlined services| Q             | A| ------------- | ---| Branch?       | 3.3| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#22848| License       | MIT| Doc PR        | n/aThe `AutowirePass` defers autowiring exceptions until later so that we don't throw autowiring exceptions for services that are ultimately removed. But, if a service is *inlined*, then it appears to be removed, and so we don't throw the exception. This fixes that.It's an easy fix - but it's a bit ugly. We're adding a bit more "state" to the passes... simply because there is some information that needs to be shared through the compiler process. There might be a better way of doing this in the future (e.g. storing some metadata on the `Compiler`), but this *does* work well.Commits-------4bcef3d [DI] Fix autowire error for inlined services
@weaverryanweaverryan deleted the fix-autowire-inlined-error branchMay 23, 2017 09:39
@fabpotfabpot mentioned this pull requestMay 29, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+1 more reviewer

@ro0NLro0NLro0NL left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

4 participants

@weaverryan@nicolas-grekas@ro0NL@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp