Drupal Coding Standards Issues | phpcs

Created on 9 February 2023, over 1 year ago
Updated 29 May 2023, about 1 year ago

Problem/Motivation

Getting following error/warnings.

FILE: /var/www/html/modules/contrib/elf/elf.module
------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
13 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/elf/elf.install
---------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
52 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/elf/src/Form/SettingsForm.php
-----------------------------------------------------------------------------------
FOUND 4 ERRORS AND 2 WARNINGS AFFECTING 5 LINES
-----------------------------------------------------------------------------------
46 | ERROR | [x] Array indentation error, expected 10 spaces but found 8
47 | ERROR | [x] Array indentation error, expected 10 spaces but found 8
48 | ERROR | [x] Array closing indentation error, expected 8 spaces but found 6
54 | ERROR | [x] Short array syntax must be used to define arrays
54 | WARNING | [x] A comma should follow the last multiline array item. Found: )
87 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/elf/src/ElfManager.php
-------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------
42 | WARNING | [x] A comma should follow the last multiline array item. Found: $key
-------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/elf/src/Plugin/Filter/FilterElf.php
------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
------------------------------------------------------------------------------------------------
42 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
47 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
52 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
139 | ERROR | [ ] Missing short description in doc comment
140 | ERROR | [ ] Missing parameter comment
142 | ERROR | [ ] Description for the @return value is missing
144 | ERROR | [ ] Public method name "FilterElf::elf_url_external" is not in lowerCamel format
------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------

Time: 2.52 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/elf/

Proposed resolution

Above error/warnings need to be fixed.

๐Ÿ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia samit.310@gmail.com

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024