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.

CommentFileSizeAuthor
#10 phpcs fixes.png14.16 KBbindu r
#8 error solved.png98.12 KBkalash-j
#2 3348616-2.patch3.32 KBsamitk

Issue fork nomarkup-3348616

Command icon 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

samit.310@gmail.com created an issue. See original summary.

samitk’s picture

Assigned: samitk » Unassigned
Status: Needs work » Needs review
StatusFileSize
new3.32 KB

Above errors/warning has been fixed.

hardikpandya’s picture

Status: Needs review » Needs work

The constants should be preferably declared in an Interface compared to a Class.

avpaderno’s picture

Title: Drupal Coding Standards Issues | phpcs » Fix the issues reported by phpcs
Priority: Normal » Minor
Issue tags: -Coding standards Phpcs, -Phpcs Drupal coding standard issue
avpaderno’s picture

In 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.

phpcs does not always suggest the right changes. It is the developer who needs to understand what is correct and what not.

kalash-j made their first commit to this issue’s fork.

kalash-j’s picture

StatusFileSize
new98.12 KB

The MR !5 have solved the issues and there is no class is created and error is solved which is given by phpcs

bindu r made their first commit to this issue’s fork.

bindu r’s picture

Status: Needs work » Needs review
StatusFileSize
new14.16 KB

Phpcs errors fixed

e0ipso’s picture

Status: Needs review » Closed (duplicate)

This was closed in a different place. Thanks for raising the issue.