Problem/Motivation

The Drupal.Semantics.FunctionTriggerError sniff was added for @trigger_error(..., E_USER_DEPRECATED) in #2908391: Add a rule for expected format of @deprecated and @trigger_error() text. We are trying to implement this in core over in #3048495: Fix Drupal.Semantics.FunctionTriggerError coding standard but it turns out this is too strict as we have a number of dynamic deprecation messages.

Steps to reproduce

Proposed resolution

Only enforce the sniff when the first argument to trigger_error() is a string, ignore the case when the deprecation message is a variable.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#3 3226902.patch3.4 KBlongwave
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

longwave created an issue. See original summary.

longwave’s picture

Status: Active » Needs review
FileSize
3.4 KB

Patched the sniff so it is skipped if the first token in the message is a variable, and added a test.

klausi’s picture

Status: Needs review » Needs work

Thanks, can you file a pull request against https://github.com/pfrenssen/coder so that we see the automated test cases run?

jonathan1055’s picture

Title: @trigger_error deprecation sniff is too strict » @trigger_error deprecation sniff is too strict - allow the message to start with a variable

@longwave If there is still a need for this enhancement I will take it on, and create a PR on github. Let me know if that would be helpful.

longwave’s picture

  • longwave authored 260ed68 on 8.3.x
    fix(FunctionTriggerError): @trigger_error deprecation sniff is too...
klausi’s picture

Status: Needs work » Fixed

Merged, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.