Drupal Coding Standards Issues | phpcs

Created on 6 February 2023, over 1 year ago
Updated 28 July 2023, 11 months ago

Problem/Motivation

Getting following error/warnings.

FILE: /var/www/html/modules/contrib/views_fields_on_off/views_fields_on_off.module
----------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
----------------------------------------------------------------------------------
82 | ERROR | Missing parameter name
84 | ERROR | Missing parameter name
142 | ERROR | Missing parameter name
144 | ERROR | Missing parameter name
175 | ERROR | Missing parameter name
----------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_fields_on_off/src/Plugin/views/field/ViewsFieldsOnOffForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------
114 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_fields_on_off/src/Plugin/views/filter/ViewsFieldsOnOffForm.php
--------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------
93 | ERROR | [ ] Parameter tags must be defined first in a doc comment
93 | ERROR | [ ] Missing parameter name
104 | ERROR | [x] Expected 1 blank line after function; 0 found
105 | ERROR | [x] The closing brace for the class must have an empty line before it
--------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------

Time: 2.15 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/views_fields_on_off/

Proposed resolution

Above error/warnings need to be fixed.

📌 Task
Status

Fixed

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