Fix the issues reported by phpcs

Created on 17 May 2023, about 1 year ago
Updated 26 June 2023, about 1 year ago

Problem/Motivation

running phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml . returns following errrors.

FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/views_exposed_filter_blocks/src/Plugin/Block/ViewsExposedFilterBlocksBlock.php
-------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 6 WARNINGS AFFECTING 8 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------
36 | WARNING | [ ] Do not concatenate strings to translatable strings, they should be part of the t() argument and you should use placeholders
58 | ERROR | [x] list(...) is forbidden, use [...] instead.
60 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
66 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
81 | ERROR | [x] list(...) is forbidden, use [...] instead.
99 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
101 | WARNING | [ ] Line exceeds 80 characters; contains 125 characters
101 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
112 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
-------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /home/arpitkayare/drupal_9.5/web/modules/contrib/views_exposed_filter_blocks/README.txt
---------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------
5 | WARNING | Line exceeds 80 characters; contains 199 characters
6 | WARNING | Line exceeds 80 characters; contains 236 characters
27 | WARNING | Line exceeds 80 characters; contains 110 characters
---------------------------------------------------------------------------------------------

Steps to reproduce

Install version 8.x-1.x-dev

run phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml .

Proposed resolution

Fix issues and create a patch.

๐Ÿ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia arpitk

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