Drupal Coding Standards Issues | phpcs

Created on 2 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/webform_submission_control/webform_submission_control.module
------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------
59 | WARNING | Only string literals should be passed to t() where possible
------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/webform_submission_control/src/Form/WebformSubmissionControlSettingsForm.php
----------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 2 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------------------------------------------------
9 | ERROR | [x] Missing class doc comment
11 | ERROR | [ ] Missing short description in doc comment
18 | ERROR | [ ] Missing short description in doc comment
25 | ERROR | [x] Missing function doc comment
62 | WARNING | [ ] Possible useless method overriding detected
62 | ERROR | [x] Missing function doc comment
66 | ERROR | [x] Missing function doc comment
68 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/webform_submission_control/src/Util/WebformSubmissioControlUtil.php
-------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------
5 | ERROR | [x] Missing class doc comment
-------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------

Time: 3.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/webform_submission_control/

Proposed resolution

Above error/warnings need to be fixed.

📌 Task
Status

Fixed

Version

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