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 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

Merged
javiereguiluz merged 2 commits intosymfony:4.3fromcodedmonkey:master
Sep 23, 2019

Conversation

@codedmonkey
Copy link
Contributor

Adds documentation for PRsymfony/symfony#28571

@javiereguiluzjaviereguiluz added the Waiting Code MergeDocs for features pending to be merged labelSep 25, 2018
symfony-splitter pushed a commit to symfony/dependency-injection that referenced this pull requestOct 3, 2018
…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
nicolas-grekas added a commit to symfony/symfony that referenced this pull requestOct 3, 2018
…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
Copy link
ContributorAuthor

Code has been merged :)

@javiereguiluzjaviereguiluz removed the Waiting Code MergeDocs for features pending to be merged labelOct 8, 2018
@javiereguiluz
Copy link
Member

@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
Copy link
Member

@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:

(<unknown>): could not find expected ':' while scanning a simple keyat line 10 column 16

What's the correct syntax for YAML? Or maybe this feature is not supported in YAML? Thanks!

@javiereguiluz
Copy link
Member

Anyone knows if this feature works with YAML config?@xabbuh?@nicolas-grekas? If it works, which is the syntax? Thanks!

@codedmonkey
Copy link
ContributorAuthor

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

        arguments:           -               - '@app.command_handler.foo'               - '@app.command_handler.bar'               - '@app.command_handler.baz'

or

        arguments:           -               App\FooCommand: '@app.command_handler.foo'               App\BarCommand: '@app.command_handler.bar'               App\BazCommand: '@app.command_handler.baz'

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
Copy link
Member

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
Copy link
Contributor

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

@javiereguiluzjaviereguiluz changed the base branch frommaster to4.3September 23, 2019 15:32
javiereguiluz added a commit that referenced this pull requestSep 23, 2019
…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
@javiereguiluzjaviereguiluz merged commit8d8c65e intosymfony:4.3Sep 23, 2019
@javiereguiluz
Copy link
Member

It took us forever ... but this is finally merged. Thank you all for your help and contributions.

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

Reviewers

@OskarStarkOskarStarkOskarStark left review comments

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

5 participants

@codedmonkey@javiereguiluz@xabbuh@OskarStark@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp