Drupal Coding Standards Issues | phpcs

Created on 3 February 2023, over 1 year ago

Problem/Motivation

Getting following error/warnings.

FILE: /var/www/html/modules/contrib/fvm/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 11 WARNINGS AFFECTING 11 LINES
----------------------------------------------------------------------
2 | WARNING | Line exceeds 80 characters; contains 117 characters
3 | WARNING | Line exceeds 80 characters; contains 118 characters
4 | WARNING | Line exceeds 80 characters; contains 117 characters
5 | WARNING | Line exceeds 80 characters; contains 120 characters
6 | WARNING | Line exceeds 80 characters; contains 118 characters
9 | WARNING | Line exceeds 80 characters; contains 122 characters
10 | WARNING | Line exceeds 80 characters; contains 117 characters
13 | WARNING | Line exceeds 80 characters; contains 118 characters
14 | WARNING | Line exceeds 80 characters; contains 117 characters
15 | WARNING | Line exceeds 80 characters; contains 117 characters
18 | WARNING | Line exceeds 80 characters; contains 83 characters
----------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/fvm/src/Form/FvmSettingsForm.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 4 WARNINGS AFFECTING 10 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
52 | ERROR | [ ] Parameter $entityDisplayRepository is not described in comment
61 | ERROR | [ ] Missing parameter name
157 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
158 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
159 | ERROR | [x] Array closing indentation error, expected 8 spaces but found 10
171 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
198 | ERROR | [x] list(...) is forbidden, use [...] instead.
223 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
233 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
241 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/fvm/src/Plugin/EntityReferenceSelection/FieldViewMode.php
---------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
83 | ERROR | Parameter $configFactory is not described in comment
---------------------------------------------------------------------------------------------

Time: 2.74 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/fvm/

Proposed resolution

Above error/warnings need to be fixed.

📌 Task
Status

RTBC

Version

2.0

Component

Code

Created by

🇮🇳India samit.310@gmail.com

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024