Skip to content

Generic transformers: the dashes of the codes of their transformers and contextual options are replaced by underscores #438

Closed

Description

@njoubert-cleverage

Description

Since 5.7 (#412), the codes of the processes, of their tasks and of the generic transformers keep their dashes, and their former name (dashes replaced by underscores) is deprecated. But the keys of the transformers and contextual_options of a generic transformer are still normalized by the Symfony configuration:

  • a generic transformer referencing another generic transformer whose code has a dash, by its code as written, triggers the 5.7 deprecation of the former name: the user cannot fix it, and the reference will fail in v6.0;
  • a generic transformer referencing a transformer service whose code has a dash (#[AsTransformer(code: 'x-y')]) fails: No transformer with code x_y (before 5.7 as well);
  • a contextual option whose code has a dash is registered with an underscore: the option given with its dash is unknown, and {{ my-option }} is not replaced.

Reproduction

clever_age_process:
    generic_transformers:
        demo-upper:
            transformers:
                callback:
                    callback: strtoupper
        demo-wrap:
            transformers:
                demo-upper: ~ # the code as written
                sprintf:
                    format: '[%s]'
    configurations:
        demo.dash_generic:
            tasks:
                entry:
                    task: constant_output
                    options:
                        output: 'abc'
                    outputs: [transform]
                transform:
                    task: transformer
                    options:
                        transformers:
                            demo-wrap: ~

Actual: [ABC], with the deprecation Using the generic transformer "demo-upper" by the name "demo_upper", with underscores instead of dashes, is deprecated: use its code "demo-upper".

Expected: [ABC] without deprecation.

Tested on v5.8, PHP 8.5, Symfony 7.4.

Cause

Configuration::appendTransformerConfigDefinition(): the transformers and contextual_options nodes do not call normalizeKeys(false), unlike the generic_transformers, configurations and tasks nodes since 5.7.

Proposed fix

normalizeKeys(false) on the transformers and contextual_options nodes. The keys of the options of the processes and of the tasks are still normalized (unchanged: an option foo-bar may be read as foo_bar by a task).

Requirements

  • Documentation updates
    • Reference
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

None for the transformers: a code written with a dash now references the transformer of this code (the former name of a generic transformer still works, with its deprecation). A contextual option written with a dash in contextual_options but given and referenced with an underscore ({{ my_option }}) must be written with an underscore.

Activity

  1. added a commit that references this issue on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions