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] deprecate short callables in yaml#31543

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

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedMay 19, 2019
edited
Loading

QA
Branch?master
Bug fix?no
New feature?no
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PRsymfony/symfony-docs#11589

This deprecates defining factories asfoo:method instead of['@foo', 'method'] in yaml.

This is confusing syntax and misses the opportunity to raise an error when one does a typo and uses a single colon instead of two.

This basically reverts#19190

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.

With a new entry inUPGRADE-4.4.md?

if (false !==strpos($callable,':') &&false ===strpos($callable,'::')) {
$parts =explode(':',$callable);

@trigger_error(sprintf('Using short %s syntax for service "%s" is deprecated since Symfony 4.4, use "[\'@%s\',\'%s\']" instead.',$parameter,$id, ...$parts),E_USER_DEPRECATED);

Choose a reason for hiding this comment

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

If$parameter is something that the user types ... then we should replaceshort %s syntax byshort "%s" syntax to avoid potential confusions.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

it can only be factory of configurator, so no issue here.

@nicolas-grekas
Copy link
MemberAuthor

UPGRADE+CHANGELOG files updated.

@nicolas-grekasnicolas-grekas merged commitf8a04fd intosymfony:masterMay 22, 2019
nicolas-grekas added a commit that referenced this pull requestMay 22, 2019
This PR was merged into the 4.4-dev branch.Discussion----------[DI] deprecate short callables in yaml| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | yes| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        |symfony/symfony-docs#11589This deprecates defining factories as `foo:method` instead of `['@foo', 'method']` in yaml.This is confusing syntax and misses the opportunity to raise an error when one does a typo and uses a single colon instead of two.This basically reverts#19190Commits-------f8a04fd [DI] deprecate short callables in yaml
@nicolas-grekasnicolas-grekas deleted the di-deprec-19190 branchMay 28, 2019 10:30
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull requestMay 29, 2019
…rekas)This PR was merged into the 4.2 branch.Discussion----------Remove short factories/configurators examplesThis PR reverts#7203, as short factories are more confusing than useful.I'm proposing to deprecate them insymfony/symfony#31543Note that some of this patch can (should) be adapted to 3.4 also.Commits-------e8cfa6e Remove short factories/configurators examples
@nicolas-grekasnicolas-grekas modified the milestones:next,4.4Oct 27, 2019
This was referencedNov 12, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz left review comments

@chalasrchalasrchalasr approved these changes

+2 more reviewers

@TobionTobionTobion approved these changes

@ogizanagiogizanagiogizanagi approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

6 participants

@nicolas-grekas@javiereguiluz@Tobion@ogizanagi@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp