Skip to content

[DI] Allow ~ instead of {} for services in Yaml #21214

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

Merged
merged 1 commit into from
Jan 9, 2017

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Jan 9, 2017

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

Now we can omit the class name, Yaml config can look like this:

services:
    AppBundle\Something: {}

While this works, the consistent way in Symfony for such cases is to use ~. This PR allows to use ~ as well, ending up with:

services:
    AppBundle\Something: ~

@nicolas-grekas nicolas-grekas added this to the 3.3 milestone Jan 9, 2017
@nicolas-grekas
Copy link
Member

👍

1 similar comment
@stof
Copy link
Member

stof commented Jan 9, 2017

👍

@fabpot
Copy link
Member

fabpot commented Jan 9, 2017

Thank you @wouterj.

@fabpot fabpot merged commit 28a1b5a into symfony:master Jan 9, 2017
fabpot added a commit that referenced this pull request Jan 9, 2017
This PR was merged into the 3.3-dev branch.

Discussion
----------

[DI] Allow ~ instead of {} for services in Yaml

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Now we can omit the class name, Yaml config can look like this:
```yaml
services:
    AppBundle\Something: {}
```

While this works, the consistent way in Symfony for such cases is to use `~`. This PR allows to use `~` as well, ending up with:
```yaml
services:
    AppBundle\Something: ~
```

Commits
-------

28a1b5a Allow setting services as null
@wouterj wouterj deleted the di/null-service branch January 9, 2017 14:03
@fabpot fabpot mentioned this pull request May 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants