8000 !iterator tag does not support comments · Issue #37972 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
!iterator tag does not support comments #37972
Closed
@lexmes

Description

@lexmes

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0