Skip to content

[TwigBridge] Unexpected deprecation notices for Twig\Extension::getName() #24522

@chalasr

Description

@chalasr
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.4

The Debug component detects usages of deprecated methods since #23816.

Problem is that the TwigBridge's Twig extensions are all implementing Twig\Extension::getName() which is deprecated since Twig 1.26 (only via @deprecated phpdoc annotations to avoid unexpected deprecation notices, see twigphp/Twig#2148).

As a result, using symfony/debug 3.4 + symfony/twig-bridge 3.4 + twig 1.x triggers the following deprecation:

The "Twig_Extension::getName()" method is deprecated since 1.26 (to be removed in 2.0), not used anymore internally. You should not extend it from "Symfony\Bridge\Twig\Extension\AssetExtension".

Same for every Twig extension provided by TwigBridge (16)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions