Drupal Coding Standards Issues | phpcs

Created on 3 January 2023, almost 2 years ago
Updated 28 March 2023, over 1 year ago

Problem/Motivation

Getting following error/warnings

FILE: /app/modules/contrib/webform_spam_words/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------
3 | WARNING | Line exceeds 80 characters; contains 161 characters
14 | WARNING | Line exceeds 80 characters; contains 118 characters
15 | WARNING | Line exceeds 80 characters; contains 117 characters
16 | WARNING | Line exceeds 80 characters; contains 89 characters
----------------------------------------------------------------------

FILE: /app/modules/contrib/webform_spam_words/src/Form/BlockwordsConfigurationSettings.php
-------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------
93 | WARNING | Avoid backslash escaping in translatable strings when possible, use "" quotes instead
153 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/webform_spam_words/src/Plugin/WebformHandler/BlockWordsWebformHandler.php
----------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------
75 | WARNING | Only string literals should be passed to t() where possible
----------------------------------------------------------------------------------------------------

Time: 1.05 secs; Memory: 10MB

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_spam_words/

Proposed resolution

Above error/warnings need to be fixed

๐Ÿ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia samit.310@gmail.com

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024