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] Fix circular reference in autowired decorators#42815

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:5.3fromshyim:fix-42791
Sep 1, 2021
Merged

Conversation

@shyim
Copy link
Contributor

QA
Branch?5.3
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#42791
LicenseMIT
Doc PR

As the Decorator pass runs after the Autowire, theinnerServiceId was always empty. I have changed that togetDecoratedService and added a test with the given example in the issue.

GwendolenLynch, COil, Roshyo, and teiling88 reacted with thumbs up emojiGwendolenLynch, COil, Roshyo, and teiling88 reacted with hooray emojiGwendolenLynch, Roshyo, and teiling88 reacted with heart emoji
@shyimshyim requested a review fromdunglas as acode ownerAugust 31, 2021 16:52
@carsonbotcarsonbot added this to the5.3 milestoneAug 31, 2021
@carsonbotcarsonbot changed the title[DI] Fix circular reference in autowired decorators[DependencyInjection] Fix circular reference in autowired decoratorsAug 31, 2021
$this->fail('AutowirePass should have thrown an exception');
}catch (AutowiringFailedException$e) {
$this->assertSame('Cannot autowire service "Symfony\Component\DependencyInjection\Tests\Compiler\NonAutowirableDecorator": argument "$decorated1" of method "__construct()" references interface "Symfony\Component\DependencyInjection\Tests\Compiler\DecoratorInterface" but no such service exists. You should maybe alias this interface to one of these existing services: "Symfony\Component\DependencyInjection\Tests\Compiler\NonAutowirableDecorator", "Symfony\Component\DependencyInjection\Tests\Compiler\NonAutowirableDecorator.inner".', (string)$e->getMessage());
$this->assertSame('Cannot autowire service "Symfony\Component\DependencyInjection\Tests\Compiler\NonAutowirableDecorator": argument "$decorated1" of method "__construct()" references interface "Symfony\Component\DependencyInjection\Tests\Compiler\DecoratorInterface" but no such service exists. You should maybe alias this interface to one of these existing services: "Symfony\Component\DependencyInjection\Tests\Compiler\Decorated", "Symfony\Component\DependencyInjection\Tests\Compiler\NonAutowirableDecorator".', (string)$e->getMessage());
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Is that so okay? As the DecoratorPass did not run until this point the.inner does not exists yet 😅

@shyim
Copy link
ContributorAuthor

The fabbot wants unreleated change which looks wrong 😅
https://fabbot.io/report/symfony/symfony/42815/b21e709d250e7eb22f9a900cf6dc9d93ab13a6de

derrabus reacted with thumbs up emoji

Copy link
Member

@jderussejderusse left a comment

Choose a reason for hiding this comment

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

Fix the issue on my side

@fabpot
Copy link
Member

Thank you@shyim.

@fabpotfabpot merged commit0d46efc intosymfony:5.3Sep 1, 2021
@mbrodala
Copy link
Contributor

Just to be sure: will there be a version 5.3.8 with this fix before 5.4? ATM we are unable to update to 5.3.7 due to this error.

@derrabus
Copy link
Member

yes

mbrodala and surikman reacted with thumbs up emoji

okhoshi added a commit to okhoshi/symfony that referenced this pull requestOct 19, 2021
okhoshi added a commit to okhoshi/symfony that referenced this pull requestOct 20, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@dunglasdunglasdunglas approved these changes

@jderussejderussejderusse approved these changes

@derrabusderrabusderrabus approved these changes

@nicolas-grekasnicolas-grekasAwaiting requested review from nicolas-grekas

Assignees

No one assigned

Projects

None yet

Milestone

5.3

Development

Successfully merging this pull request may close these issues.

7 participants

@shyim@fabpot@mbrodala@derrabus@dunglas@jderusse@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp