Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[DependencyInjection] Add documentation for service locator changes#10397
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
…rvice matching (codedmonkey)This PR was squashed before being merged into the 4.2-dev branch (closes #28571).Discussion----------[DependencyInjection] Improve ServiceLocatorTagPass service matching| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | #26892| License | MIT| Doc PR |symfony/symfony-docs#10397Allows omitting of keys for service locator arguments (it will automatically take over the original definition alias).Commits-------1c1210a3e8 [DependencyInjection] Improve ServiceLocatorTagPass service matching
…rvice matching (codedmonkey)This PR was squashed before being merged into the 4.2-dev branch (closes#28571).Discussion----------[DependencyInjection] Improve ServiceLocatorTagPass service matching| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#26892| License | MIT| Doc PR |symfony/symfony-docs#10397Allows omitting of keys for service locator arguments (it will automatically take over the original definition alias).Commits-------1c1210a [DependencyInjection] Improve ServiceLocatorTagPass service matching
codedmonkey commentedOct 5, 2018
Code has been merged :) |
javiereguiluz commentedOct 8, 2018
@codedmonkey for this kind of features, we always add some comments and examples in the code samples, to make it easier to understand. Could you please my reword to do that? Thanks! |
javiereguiluz commentedOct 11, 2018
@codedmonkey the current YAML example that I added is wrong: # config/services.yamlservices:app.command_handler_locator:class:Symfony\Component\DependencyInjection\ServiceLocatorarguments: -App\FooCommand:'@app.command_handler.foo'App\BarCommand:'@app.command_handler.bar'# if the element has no key, the ID of the original service is used'@app.command_handler.baz' It says: What's the correct syntax for YAML? Or maybe this feature is not supported in YAML? Thanks! |
javiereguiluz commentedOct 29, 2018
Anyone knows if this feature works with YAML config?@xabbuh?@nicolas-grekas? If it works, which is the syntax? Thanks! |
codedmonkey commentedNov 1, 2018
My apologies for the late response. It looks like combining collections aand arrays in YAML is indeed a no-go,symfony/symfony#23664. It's possible to do either or but not a combination of the two. Trying to add the feature would just increase complexity. Any ideas how best to address this in the docs? |
xabbuh commentedNov 6, 2018
That's correct, a collection in YAML is either a sequence or a mapping. I would just add a second example like this: # config/services.yamlservices:app.command_handler_locator:class:Symfony\Component\DependencyInjection\ServiceLocatorarguments: -App\FooCommand:'@app.command_handler.foo'App\BarCommand:'@app.command_handler.bar'# or if the element has no key, the ID of the original service is usedapp.another_command_handler_locator:class:Symfony\Component\DependencyInjection\ServiceLocatorarguments: - -'@app.command_handler.baz' |
| previous Symfony versions you always needed to add the | ||
| ``container.service_locator`` tag explicitly. | ||
| ..versionadded::4.2 |
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.
Please add a blank line after the directive
…tor changes (codedmonkey, javiereguiluz)This PR was submitted for the master branch but it was merged into the 4.3 branch instead (closes#10397).Discussion----------[DependencyInjection] Add documentation for service locator changesAdds documentation for PRsymfony/symfony#28571Commits-------8d8c65e Rewordbc5ef85 [DependencyInjection] Add documentation for service locator changes
javiereguiluz commentedSep 23, 2019
It took us forever ... but this is finally merged. Thank you all for your help and contributions. |
Adds documentation for PRsymfony/symfony#28571