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] Add a mechanism to deprecate public services to private#36470

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

Conversation

fancyweb
Copy link
Contributor

@fancywebfancyweb commentedApr 16, 2020
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

This PR adds a mechanism to easily deprecate public services to private, ie a public service will be private in a next version.

It works with a tag and a compiler pass. The pass creates a deprecated public alias of the public service.

It is ran "after removing" because we want to trigger only on direct accesses to the public service ($container->get()): if the public service was removed, we don't need to do anything because there is no impact.

All references to the public service are kept because the deprecated public alias is created afterResolveReferencesToAliasesPass so only direct access actually uses the deprecated alias.
All references to the public service are altered to a direct reference to the alias target service so that they don't trigger the alias deprecation.

Thanks to@nicolas-grekas for sharing some ideas and helping me !

ro0NL, yceruto, xabbuh, maxhelias, Jibbarth, and mamoot64 reacted with thumbs up emojiJibbarth reacted with hooray emoji
@fancywebfancywebforce-pushed thedi-deprecate-public-service branch from51e8723 toe1b3324CompareApril 22, 2020 15:53
@fancywebfancywebforce-pushed thedi-deprecate-public-service branch frome1b3324 to0df92cbCompareApril 30, 2020 17:52
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.

Minor things and GTM.

@fancywebfancywebforce-pushed thedi-deprecate-public-service branch fromff01714 to0a8853bCompareMay 4, 2020 13:37
@nicolas-grekas
Copy link
Member

Thank you@fancyweb.

@nicolas-grekasnicolas-grekas merged commita910192 intosymfony:masterMay 4, 2020
@fancywebfancyweb deleted the di-deprecate-public-service branchMay 4, 2020 13:43
@fabpotfabpot mentioned this pull requestMay 5, 2020
nicolas-grekas added a commit that referenced this pull requestDec 8, 2020
… private container to remove false-positive deprecations (nicolas-grekas)This PR was merged into the 5.1 branch.Discussion----------[FrameworkBundle] acces public-deprecated services via the private container to remove false-positive deprecations| Q             | A| ------------- | ---| Branch?       | 5.1| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       | -| License       | MIT| Doc PR        | -Something we missed in#36470 apparently.Commits-------d502ba9 [FrameworkBundle] acces public-deprecated services via the private container to remove false-positive deprecations
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

@stofstofstof approved these changes

@ycerutoycerutoyceruto approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
5.1
Development

Successfully merging this pull request may close these issues.

5 participants
@fancyweb@nicolas-grekas@stof@yceruto@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp