Detection of DI on GlobalDrupalSniff is too loose.

Created on 29 November 2024, 4 days ago

Problem/Motivation

Currently the following must be true to catch \Drupal:: calls in DI classes:

Class doesn't extend anything OR Doesn't extend one of those defined as base classes
Is not a service itself
Doesn't implement ContainerInjectionInterface

So this omits a lot of legit cases of plugins as they commonly will use ContainerFactoryPluginInterface

Proposed resolution

Have better detection of container interfaces

🐛 Bug report
Status

Active

Version

8.3

Component

Coder Sniffer

Created by

🇨🇦Canada b_sharpe

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024