Problem/Motivation
Getting following warnings.
FILE: /var/www/html/modules/contrib/dbee/dbee.module
-------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
-------------------------------------------------------------------------------------
19 | WARNING | Global constants should not be used, move it to a class or interface
20 | WARNING | Global constants should not be used, move it to a class or interface
21 | WARNING | Global constants should not be used, move it to a class or interface
22 | WARNING | Global constants should not be used, move it to a class or interface
23 | WARNING | Global constants should not be used, move it to a class or interface
24 | WARNING | Global constants should not be used, move it to a class or interface
25 | WARNING | Global constants should not be used, move it to a class or interface
-------------------------------------------------------------------------------------
Time: 3.59 secs; Memory: 12MB
Steps to reproduce
Run following command
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/dbee/
Proposed resolution
Above warnings need to be fixed.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | interdiff_2-4.txt | 1 KB | samitk |
| #4 | 3339421-4.patch | 12.39 KB | samitk |
| #2 | 3339421-2.patch | 11.65 KB | samitk |
Issue fork dbee-3339421
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3.x
changes, plain diff MR !8
- 3339421-drupal-coding-standards
changes, plain diff MR !11
Comments
Comment #2
samitk commentedAbove warnings are fixed.
Comment #4
samitk commentedFixed failed build issue.
interdiff with #2
Comment #7
Charchil Khandelwal commentedComment #9
Charchil Khandelwal commentedComment #10
jcnventuraComment #14
jcnventuraTo be honest, this is an awful coding standard. It would have been a good idea to avoid it a long time ago, but I'd rather disable phpcs on these lines than to do the changes proposed here.
Comment #18
jcnventura