-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Q | A |
---|---|
Bug report? | no |
Feature request? | yes |
BC Break report? | no |
RFC? | no |
Symfony version | 4.0.3, master |
When injecting tagged services the whitespace around the tag name is significant (at least with YAML). Because unquoted, tagged values are not evaluated in the YAML parser, the whitespace will be passed to the DI component. It would be nice if the !tagged
would behave more like !!str
which seems to trim whitespace around unquoted strings. Alternatively, a warning message which indicates an invalid tag name would be fine too.
Example:
services:
app.foo:
class: App\Foo
arguments: [ !tagged bar ]
The container compiler will try to inject services with the tag "bar " (note the trailing space).