Fix the issues reported by PHPCS

Created on 19 April 2023, about 1 year ago
Updated 3 May 2023, about 1 year ago

Problem/Motivation

FILE: ...www/html/contribution/drupal10/web/modules/contrib/broken_config/README.md
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------------
2 | WARNING | Line exceeds 80 characters; contains 343 characters
3 | WARNING | Line exceeds 80 characters; contains 231 characters
6 | WARNING | Line exceeds 80 characters; contains 263 characters
8 | WARNING | Line exceeds 80 characters; contains 86 characters
16 | WARNING | Line exceeds 80 characters; contains 81 characters
--------------------------------------------------------------------------------

FILE: ...ution/drupal10/web/modules/contrib/broken_config/src/BrokenConfigBatch.php
--------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------------
5 | ERROR | [x] Non-namespaced classes/interfaces/traits should not be
| | referenced with use statements
15 | ERROR | [ ] Missing parameter type
17 | ERROR | [ ] Missing parameter type
32 | ERROR | [ ] Missing parameter type
34 | ERROR | [ ] Missing parameter type
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...ion/drupal10/web/modules/contrib/broken_config/src/Form/ScanConfigForm.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
--------------------------------------------------------------------------------
77 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
84 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
85 | ERROR | [ ] The array declaration extends to column 120 (the limit is
| | 80). The array content should be split up over multiple
| | lines
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...ion/drupal10/web/modules/contrib/broken_config/src/BrokenConfigScanner.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
59 | ERROR | [ ] Missing parameter type
122 | ERROR | [x] Return comment indentation must be 3 spaces, found 2 spaces
139 | ERROR | [x] Concat operator must be surrounded by a single space
150 | ERROR | [x] Return comment indentation must be 3 spaces, found 2 spaces
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 417ms; Memory: 10MB

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

Proposed resolution

Fix all the issues reported for Drupal and DrupalPractice standards.

Remaining tasks

Patch review.

📌 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.69.0 2024