Fix the issues reported by PHPCS

Created on 10 April 2023, over 1 year ago
Updated 26 April 2023, over 1 year ago

Problem/Motivation

Fix the issues reported by PHPCS for Drupal and DrupalPractice standards.

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig tsi/

Proposed resolution

Fix all the errors and warnings which are mentioned in remaining tasks.

Remaining tasks

Fix all the remaining tasks:

FILE: /var/www/html/contribution/drupal10/web/modules/contrib/tsi/README.md
---------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------
3 | WARNING | Line exceeds 80 characters; contains 95 characters
---------------------------------------------------------------------------

FILE: ...tribution/drupal10/web/modules/contrib/tsi/tests/src/Kernel/TsiApiTest.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AND 4 WARNINGS AFFECTING 6 LINES
--------------------------------------------------------------------------------
8 | WARNING | [ ] The class short comment should describe what the class does
| | and not simply repeat the class name
43 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
48 | WARNING | [x] '@todo: Find out why we need this...' should match the
| | format '@todo Fix problem X here.'
50 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
51 | ERROR | [x] Expected 1 blank line after function; 2 found
54 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: .../www/html/contribution/drupal10/web/modules/contrib/tsi/src/TsiService.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
14 | ERROR | [x] Additional blank lines found at end of doc comment
73 | ERROR | [ ] The array declaration extends to column 132 (the limit is
| | 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...ibution/drupal10/web/modules/contrib/tsi/src/Commands/TsiDrushCommands.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------
31 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
49 | ERROR | Parameter comment must start with a capital letter
51 | ERROR | Parameter comment must start with a capital letter
62 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------

FILE: .../contribution/drupal10/web/modules/contrib/tsi/src/TsiServiceInterface.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
--------------------------------------------------------------------------------
7 | WARNING | [ ] The class short comment should describe what the class does
| | and not simply repeat the class name
22 | ERROR | [x] Additional blank lines found at end of doc comment
25 | ERROR | [ ] Missing short description in doc comment
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 537ms; Memory: 10MB

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India urvashi_vora Madhya Pradesh, India

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