Skip to content

[RFC][Yaml] Add custom tags support #21185

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy