UnsilencedDeprecation failures with namespace qualifiers

Created on 4 June 2024, 10 months ago

Problem/Motivation

When enforcing built-in functions to be fully qualified (See rationale https://github.com/previousnext/coding-standard/issues/80), the Drupal.Semantics.UnsilencedDeprecation.UnsilencedDeprecation rule incorrectly reports an error.

Steps to reproduce

@\trigger_error($message)

Error with:

All trigger_error calls used for deprecation must be prefixed by an "@"
| | (Drupal.Semantics.UnsilencedDeprecation.UnsilencedDeprecation)

Proposed resolution

Check for slashes or be more intelligent about getting the true function name. A backslash is after all not a part of the function name.

Even if the FQ rule is not endorsed by this project, it should be more true to how PHP looks at keywords/identifiers etc.

Remaining tasks

Fix

🐛 Bug report
Status

Active

Version

8.3

Component

Coder Sniffer

Created by

🇦🇺Australia dpi Perth, Australia

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

Comments & Activities

Production build 0.71.5 2024