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 service autowiring inheritance#19643

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:2.8fromchalasr:dic_fix_autowire_inherit
Aug 19, 2016

Conversation

@chalasr
Copy link
Member

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

This makes services inherit theautowire attribute from their parent and fix the ability to override it from the child.

Fixed cases:

  • Simple inheritance
parent:class:Fooabstract:trueautowire:truechild:class:Foo
  • Set in the child (only)
parent:class:Fooabstract:truechild:class:Fooautowire:true
  • Set in the parent, changed in the child
parent:class:Fooabstract:trueautowire:truechild:class:Fooautowire:false

sc0rp10, hason, Simperfit, and ogizanagi reacted with thumbs up emoji
@dunglas
Copy link
Member

👍

@weaverryan
Copy link
Member

There's technically a minor BC break: a service whose parent is autowired, would not have been autowired before, but now it would be. But, except for anoptional dependency in the constructor, instantiation of that child would have failed, because it would be missing its autowired dependencies. So, the BC break is for child services that have optional, type-hinted constructor args: the container will now try to autowire those, but it didn't before.

Still, this is a bug and that's seems like areal edge-case. I think we should fix it.

If I'm right, should be update the CHANGELOG or UPGRADE doc?

👍

@chalasrchalasrforce-pushed thedic_fix_autowire_inherit branch from22fd618 to143c5c1CompareAugust 17, 2016 02:12
@chalasr
Copy link
MemberAuthor

CHANGELOG updated, thanks@weaverryan.

@chalasrchalasrforce-pushed thedic_fix_autowire_inherit branch from143c5c1 to04ce15dCompareAugust 17, 2016 02:25
@jakzal
Copy link
Contributor

👍

Although i wouldn't treat it as a BC break. Technically it should either be a bugfix or a BC break :)

@chalasr
Copy link
MemberAuthor

@jakzal Let me know if I can do something for that.
For now this is described as a bugfix but referenced as a BC break in the DI's changelog.

2.8.9
-----

*[BC BREAK] fixed inheritance of the`autowire` flag
Copy link
Member

Choose a reason for hiding this comment

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

Like@jakzal, I think it's more a bug than a a BC break. Anyway, we should either remove the[BC BREAK] here or merge this PR on master.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

The BC break flag has been removed as you and@jakzal seem to agree for treat it as a bug fix only.

@chalasrchalasrforce-pushed thedic_fix_autowire_inherit branch from04ce15d toc49f056CompareAugust 19, 2016 15:09
-----

* fixed inheritance of the`autowire` flag

Copy link
Member

Choose a reason for hiding this comment

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

The whole paragraph should be removed as the CHANGELOG is automatically generated.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

done

@chalasrchalasrforce-pushed thedic_fix_autowire_inherit branch fromc49f056 tofb95bdcCompareAugust 19, 2016 15:56
@fabpot
Copy link
Member

Thank you@chalasr.

@fabpotfabpot merged commitfb95bdc intosymfony:2.8Aug 19, 2016
fabpot added a commit that referenced this pull requestAug 19, 2016
…chalasr)This PR was merged into the 2.8 branch.Discussion----------[DependencyInjection] Fix service autowiring inheritance| Q             | A| ------------- | ---| Branch?       | 2.8| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#19615| License       | MIT| Doc PR        | n/aThis makes services inherit the `autowire` attribute from their parent and fix the ability to override it from the child.Fixed cases:- Simple inheritance```yamlparent:    class: Foo    abstract: true    autowire: truechild:    class: Foo```- Set in the child (only)```yamlparent:    class: Foo    abstract: truechild:    class: Foo    autowire: true```- Set in the parent, changed in the child```yamlparent:    class: Foo    abstract: true    autowire: truechild:    class: Foo    autowire: false```Commits-------fb95bdc [DIC] Fix service autowiring inheritance
@chalasrchalasr deleted the dic_fix_autowire_inherit branchAugust 19, 2016 16:31
This was referencedSep 2, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@chalasr@dunglas@weaverryan@jakzal@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp