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] Replace autowiring BC break by regular deprecation#22384

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:masterfromnicolas-grekas:di-deprec-autow
Apr 12, 2017

Conversation

@nicolas-grekas
Copy link
Member

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

It happens that doing so is really easy now. And as discussed in#22295, this should be more friendly to our users.

kiler129 reacted with thumbs up emoji
@nicolas-grekasnicolas-grekas added this to the3.3 milestoneApr 11, 2017
@nicolas-grekasnicolas-grekas changed the title[DI] Repace autowiring BC break by regular deprecation[DI] Replace autowiring BC break by regular deprecationApr 11, 2017
Copy link
Member

@stofstof left a comment

Choose a reason for hiding this comment

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

Deprecating rather than breaking BC is always better

@kiler129
Copy link
Contributor

@nicolas-grekas: Big thumbs up for this change! BC promise and being open & flexible with changes are the most important reason for using Symfony in serious projects.

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commit0ed087d intosymfony:masterApr 12, 2017
fabpot added a commit that referenced this pull requestApr 12, 2017
…n (nicolas-grekas)This PR was merged into the 3.3-dev branch.Discussion----------[DI] Replace autowiring BC break by regular deprecation| Q             | A| ------------- | ---| Branch?       | 3.3| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | yes| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -It happens that doing so is really easy now. And as discussed in#22295, this should be more friendly to our users.Commits-------0ed087d [DI] Replace autowiring BC break by regular deprecation
@nicolas-grekasnicolas-grekas deleted the di-deprec-autow branchApril 12, 2017 14:32
@fabpotfabpot mentioned this pull requestMay 1, 2017
}

if (isset($this->types[$type])) {
@trigger_error(sprintf('Autowiring services based on the types they implement is deprecated since Symfony 3.3 and won\'t be supported in version 4.0. You should %s the "%s" service to "%s" instead.',isset($this->types[$this->types[$type]]) ?'alias' :'rename (or alias)',$this->types[$type],$type),E_USER_DEPRECATED);
Copy link
Contributor

Choose a reason for hiding this comment

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

If somebody typehints an implementation instead of an interface, this deprecation is misleading. They do not need to change the services but also only change the typhint.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This should be the case in createTypeAlternatives, see "or type-hint against etc."

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes but that only happens if no autowired service can be found. If it works with a by-type deprecation, the alternatives are not suggested.

Copy link
Contributor

Choose a reason for hiding this comment

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

e.g. if you typehint the serializer implementation instead of the interface

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof approved these changes

+1 more reviewer

@TobionTobionTobion 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.

6 participants

@nicolas-grekas@kiler129@fabpot@stof@Tobion@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp