Skip to content

GetFiltersAndFunctionsToAsTwigAttributeRector is applied in Symfony 6, but is not supported #9856

Description

@micheh

Bug Report

Subject Details
Rector version 2.6.2
symfony 6.4
twig/twig 3.28.0

Minimal PHP Code Causing Issue

I use withComposerBased and have Symfony 6.4 and Twig 3.28 installed.

>withAttributesSets()
->withComposerBased(twig: true, symfony: true)

Rector executes the rule GetFiltersAndFunctionsToAsTwigAttributeRector. However, the two Twig Attributes were introduced in Symfony 7.3 and do nothing in previous Symfony versions. Since the TwigExtension is removed with the rule, the Twig filters and function will not be available anymore.

Expected Behaviour

The rule should only be executed if Twig >= 3.21 and Symfony >= 7.3.

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