Fix the issues reported by PHP_CodeSniffer

Created on 24 September 2024, 2 months ago

Problem/Motivation

FILE: D:\wamp64\www\d10_2_2\modules\menu_banner\menu_banner.admin.inc
--------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------
18 | ERROR | [x] Use null coalesce operator instead of ternary operator.
32 | ERROR | [x] Use null coalesce operator instead of ternary operator.
33 | ERROR | [x] Array indentation error, expected 6 spaces but found 7
35 | ERROR | [x] Use null coalesce operator instead of ternary operator.
36 | ERROR | [x] Array indentation error, expected 6 spaces but found 7
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------

FILE: D:\wamp64\www\d10_2_2\modules\menu_banner\menu_banner.info
------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 3 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------
1 | WARNING | [ ] Remove "project" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | [ ] Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | [ ] Remove "version" from the info file, it will be added by drupal.org packaging automatically
1 | ERROR | [ ] Duplicate entry for "core" in info file
12 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------

FILE: D:\wamp64\www\d10_2_2\modules\menu_banner\menu_banner.install
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: D:\wamp64\www\d10_2_2\modules\menu_banner\menu_banner.module
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 16 ERRORS AFFECTING 14 LINES
---------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
62 | ERROR | [x] Use null coalesce operator instead of ternary operator.
157 | ERROR | [x] Use null coalesce operator instead of ternary operator.
162 | ERROR | [x] Use null coalesce operator instead of ternary operator.
163 | ERROR | [x] Array indentation error, expected 6 spaces but found 7
167 | ERROR | [x] Use null coalesce operator instead of ternary operator.
167 | ERROR | [ ] The array declaration extends to column 127 (the limit is 120). The array content should be split up over multiple
| | lines
172 | ERROR | [x] Array indentation error, expected 6 spaces but found 7
172 | ERROR | [x] Use null coalesce operator instead of ternary operator.
174 | ERROR | [x] Use null coalesce operator instead of ternary operator.
175 | ERROR | [x] Array indentation error, expected 6 spaces but found 7
224 | ERROR | [ ] Description for the @return value is missing
228 | ERROR | [x] Use null coalesce operator instead of ternary operator.
231 | ERROR | [x] Use null coalesce operator instead of ternary operator.
269 | ERROR | [ ] Missing parameter comment
280 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
---------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run phpcs command to get the drupal coding standard issues.

Proposed resolution

Many of the issues can be fixed by running the phpcbf command. For the remaining ones, we will need to manually address and then commit these changes before pushing them.

📌 Task
Status

Needs work

Version

1.0

Component

Code

Created by

🇺🇸United States sunil jolapara 3265 Summitrun Drive, Independence, KY, 41051

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024