Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ogizanagi left a comment
There was a problem hiding this 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 commentedMay 20, 2019
UPGRADE+CHANGELOG files updated. |
Uh oh!
There was an error while loading.Please reload this page.
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
…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
Uh oh!
There was an error while loading.Please reload this page.
This deprecates defining factories as
foo:methodinstead 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