Problem/Motivation
Getting following errors/warning.
FILE: /var/www/html/modules/contrib/nomarkup/tests/src/FunctionalJavascript/IntegrationTest.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
50 | ERROR | [ ] The array declaration extends to column 92 (the limit is 80). The array content should be split up over multiple lines
67 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
-----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------
FILE: /var/www/html/modules/contrib/nomarkup/nomarkup.module
-------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------
12 | WARNING | Global constants should not be used, move it to a class or interface
-------------------------------------------------------------------------------------
Time: 4.27 secs; Memory: 6MB
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/nomarkup/
Proposed resolution
Above errors/warning need to be fixed.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | phpcs fixes.png | 14.16 KB | bindu r |
| #8 | error solved.png | 98.12 KB | kalash-j |
Issue fork nomarkup-3348616
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:
Comments
Comment #2
samitk commentedAbove errors/warning has been fixed.
Comment #3
hardikpandya commentedThe constants should be preferably declared in an Interface compared to a Class.
Comment #4
avpadernoComment #5
avpadernoIn this case, there is no interface where that constant should be placed. Actually, I do not see any gain in defining a class just for a single constant.
phpcsdoes not always suggest the right changes. It is the developer who needs to understand what is correct and what not.Comment #8
kalash-j commentedThe MR !5 have solved the issues and there is no class is created and error is solved which is given by phpcs
Comment #10
bindu r commentedPhpcs errors fixed
Comment #11
e0ipsoThis was closed in a different place. Thanks for raising the issue.