Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for named arguments in service definitions #998

Closed
stof opened this issue Aug 11, 2017 · 2 comments
Closed

Support for named arguments in service definitions #998

stof opened this issue Aug 11, 2017 · 2 comments
Labels

Comments

@stof
Copy link
Contributor

stof commented Aug 11, 2017

For autowired services, Symfony 3.3+ supports using named arguments when one of the argument must be wired manually, instead of positional arguments:

services:
    foo:
        class: Baz
        arguments:
            '$formatter': '@my_formatter'
<service id="foo" class="Baz">
    <argument key="$formatter" type="service" id="my_formatter" />
</service>

Currently, the bundle validates this against the type of the first argument, which is the wrong check.

note that named arguments are triggered for keys starting with a $. String keys not starting with a $ have no special meaning (and are deprecated)

@Haehnchen Haehnchen added the todo label Oct 27, 2017
Haehnchen added a commit that referenced this issue Oct 27, 2017
Haehnchen added a commit that referenced this issue Oct 27, 2017
Haehnchen added a commit that referenced this issue Oct 28, 2017
Haehnchen added a commit that referenced this issue Oct 28, 2017
Haehnchen added a commit that referenced this issue Oct 28, 2017
Haehnchen added a commit that referenced this issue Oct 28, 2017
Haehnchen added a commit that referenced this issue Oct 31, 2017
Haehnchen added a commit that referenced this issue Oct 31, 2017
Haehnchen added a commit that referenced this issue Oct 31, 2017
Haehnchen added a commit that referenced this issue Oct 31, 2017
Haehnchen added a commit that referenced this issue Oct 31, 2017
Haehnchen added a commit that referenced this issue Oct 31, 2017
@Haehnchen Haehnchen added fixed and removed todo labels Nov 1, 2017
@King2500
Copy link
Contributor

The completion for $arg keys is not working for me in YAML services config.

Is that implemented yet?

@Haehnchen
Copy link
Owner

yaml service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants