Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

!iterator tag does not support comments #37972

Copy link
Copy link
Closed
@lexmes

Description

@lexmes
Issue body actions

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.