Drupal Coding Standards Issues | phpcs

Created on 3 February 2023, almost 2 years ago

Problem/Motivation

Getting following error/warnings.

FILE: /var/www/html/modules/contrib/contact_mail/src/Hook/Theme.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
12 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/contact_mail/src/Hook/MailAlter.php
-----------------------------------------------------------------------------
FOUND 2 ERRORS AND 4 WARNINGS AFFECTING 6 LINES
-----------------------------------------------------------------------------
69 | WARNING | [ ] Unused variable $hidden.
71 | WARNING | [ ] Unused variable $form.
85 | WARNING | [ ] Unused variable $k.
93 | WARNING | [ ] Unused variable $k.
109 | ERROR | [x] Use null coalesce operator instead of ternary operator.
112 | ERROR | [x] Each PHP statement must be on a line by itself
-----------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------

Time: 4.59 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/contact_mail/

Proposed resolution

Above error/warnings need to be fixed.

๐Ÿ“Œ Task
Status

RTBC

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.71.5 2024