Drupal Coding Standards Issues | phpcs

Created on 1 February 2023, over 1 year ago

Problem/Motivation

Getting following error/warnings.

FILE: /var/www/html/modules/contrib/entity_reference_views/README.md
------------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
------------------------------------------------------------------------
3 | WARNING | [ ] Line exceeds 80 characters; contains 165 characters
6 | WARNING | [ ] Line exceeds 80 characters; contains 99 characters
15 | WARNING | [ ] Line exceeds 80 characters; contains 90 characters
37 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/entity_reference_views/src/Plugin/Field/FieldWidget/Select2ViewsWidget.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 2 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
30 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
31 | ERROR | [x] Array closing indentation error, expected 4 spaces but found 6
58 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
62 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
146 | ERROR | [x] Missing function doc comment
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/entity_reference_views/src/Plugin/Field/FieldWidget/AutocompleteViewsWidget.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 2 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
30 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
31 | ERROR | [x] Array closing indentation error, expected 4 spaces but found 6
58 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
62 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
137 | ERROR | [x] Missing function doc comment
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------

Time: 4.84 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/entity_reference_views/

Proposed resolution

Above error/warnings need to be fixed.

📌 Task
Status

Needs review

Version

1.1

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