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
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3226902.patch | 3.4 KB | longwave |
Comments
Comment #2
longwaveComment #3
longwavePatched the sniff so it is skipped if the first token in the message is a variable, and added a test.
Comment #4
klausiThanks, can you file a pull request against https://github.com/pfrenssen/coder so that we see the automated test cases run?
Comment #5
jonathan1055 commented@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.
Comment #6
longwaveI opened https://github.com/pfrenssen/coder/pull/154
Comment #8
klausiMerged, thanks!