Closed
Description
Symfony version(s) affected: 4.4.10
Description
When using the !iterator
tag in yaml service definition files it does not support comments between the array initializer brackes. The bug occurs in constructor arguments as well when using the calls
defintion.
How to reproduce
Create a services.yaml and paste the following contents:
Foo\BarInterface:
class: Foo\Bar
arguments:
- [!iterator [
'@service_a',
# '@service_b',
]]
You will get an exception: Uncaught Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: "!iterator" tag only accepts arrays of "@service" references in "yaml".