Skip to content

Add support for Twig 3 classes into tagged service interface requirements inspection #1548

@FlyingDR

Description

@FlyingDR

PHPStorm 2020.2.3, Symfony plugin 0.21.203

There is an inspection in plugin that checks required interface implementation for Symfony services with certain tags.

However in a case if Twig 3.x is used in the project and Symfony service is tagged with either twig.extension or twig.loader - Symfony plugin reports warning like Class needs to implement '\Twig_ExtensionInterface' for tag 'twig.extension'

This is only correct for Twig 1.x and 2.x, but for 3.x only namespaced classes (Twig\Extension\ExtensionInterface and Twig\Loader\LoaderInterface) are available so this inspection is not correct for this case.

It looks like these entries need to be corrected with additional test for Twig version, used by the project. Hope it can be determined, e.g. from Composer integration that is available in PHPStorm.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions