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] Handle container.autowiring.strict_mode to opt-out from legacy autowiring#24671

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
nicolas-grekas merged 1 commit intosymfony:3.4fromnicolas-grekas:autow-strict
Oct 24, 2017

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedOct 23, 2017
edited
Loading

QA
Branch?3.4
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

To preserve BC, autowiring still wires things in hybrid 2.8/3.3 modes.
But 2.8 mode is really a foot gun.
I propose to add a new parameter in SF3.4, to opt-out of this 2.8 mode, and enable this strict mode for all new projects.
WDYT?
(seesymfony/recipes#221 for corresponding change on Flex recipe)

apetitpa and dunglas reacted with thumbs up emojiogizanagi reacted with hooray emoji
}

if (isset($this->definedTypes[$type])) {
returnnewTypedReference($this->types[$type],$type);
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't we have a deprecation warning triggered here, to tell people to register the type for the new system rather than relying on old types (as you disable the loading in strict mode)

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

They will get an exception saying that. Not sure there is anything else needed.

Copy link
MemberAuthor

@nicolas-grekasnicolas-grekasOct 24, 2017
edited
Loading

Choose a reason for hiding this comment

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

@stof I re-enabled by-explicit-autowiring-type in strict mode, that should address your concern, isn't it?

@stof
Copy link
Member

wouldn't this cause issues to use a parameter for that ? Wouldn't any bundle be free to overwrite it ?

@nicolas-grekasnicolas-grekas changed the title[DI] Handle container.autowiring.strict_mode to opt-out from legacy a…[DI] Handle container.autowiring.strict_mode to opt-out from legacy autowiringOct 23, 2017
@nicolas-grekas
Copy link
MemberAuthor

Wouldn't any bundle be free to overwrite it ?

that's true, but is this really an issue?

@stof
Copy link
Member

that's true, but is this really an issue?

Well, that's precisely the reason why our defaults are file-level.

@nicolas-grekas
Copy link
MemberAuthor

Well ok. But we always advertised autowiring as a bad idea for bundles before 3.3. I don't think this would be an issue.

@nicolas-grekas
Copy link
MemberAuthor

I think this is important as we already got several reports by ppl being biten by autoregistration.

Copy link
Contributor

@ogizanagiogizanagi left a comment

Choose a reason for hiding this comment

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

Exactly what I needed today 👍

@nicolas-grekasnicolas-grekas merged commita4a0ae2 intosymfony:3.4Oct 24, 2017
nicolas-grekas added a commit that referenced this pull requestOct 24, 2017
…t from legacy autowiring (nicolas-grekas)This PR was merged into the 3.4 branch.Discussion----------[DI] Handle container.autowiring.strict_mode to opt-out from legacy autowiring| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -To preserve BC, autowiring still wires things in hybrid 2.8/3.3 modes.But 2.8 mode is really a foot gun.I propose to add a new parameter in SF3.4, to opt-out of this 2.8 mode, and enable this strict mode for all new projects.WDYT?(seesymfony/recipes#221 for corresponding change on Flex recipe)Commits-------a4a0ae2 [DI] Handle container.autowiring.strict_mode to opt-out from legacy autowiring
@nicolas-grekasnicolas-grekas deleted the autow-strict branchOctober 24, 2017 12:38
This was referencedOct 30, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dunglasdunglasdunglas approved these changes

@stofstofstof approved these changes

+1 more reviewer

@ogizanagiogizanagiogizanagi approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

5 participants

@nicolas-grekas@stof@dunglas@ogizanagi@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp