8000 [RFC][Yaml] Add custom tags support · Issue #21185 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[RFC][Yaml] Add custom tags support #21185
Closed
@GuilhemN

Description

@GuilhemN
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes
Symfony version 3.3.0

Custom tags support is a very important feature imo that currently lacks to the yaml component.
It is basically allowing things like:

services:
    square_printer:
        arguments: [ !color red ]

By having a dedicated system for tags, we could centralize their management and avoid duplication (here and here).
If wanted, it could also be used in the core to remove reserved keys in config files.
For example,

services:
    _defaults:
        autowire: true

    my_service:
        class: FooBar
        arguments:
            - '@service1'
            - =iterator:
                - '@service2'
                - '@service3'

# could become
services:
    !defaults:
        autowire: true

    my_service:
        class: FooBar
        arguments:
            - '@service1'
            - !iterator
                - '@service2'
                - '@service3'

WDYT?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0