Fix the issues reported by PHP_CodeSniffer

Created on 20 September 2024, 3 months ago

Problem/Motivation

FILE: block_component_library\block_component_library.info.yml
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
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
-------------------------------------------------------------------------------------------------------------

FILE: block_component_library\block_component_library.install
-----------------------------------------------------------------------------------------------------------------------------
FOUND 42 ERRORS AND 4 WARNINGS AFFECTING 30 LINES
-----------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
4 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\field\Entity\FieldConfig.
16 | ERROR | [x] Expected 1 space after IF keyword; 0 found
16 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
21 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
21 | ERROR | [x] Object operator not indented correctly; expected 6 spaces but found 4
25 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
29 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
29 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
30 | ERROR | [x] Expected 1 space after IF keyword; 0 found
30 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
36 | ERROR | [x] Expected 1 space after IF keyword; 0 found
36 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
39 | ERROR | [x] Expected 1 space after IF keyword; 0 found
39 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
48 | ERROR | [x] Expected 1 space before opening brace; found 0
50 | ERROR | [x] Expected 1 space after IF keyword; 0 found
50 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
54 | ERROR | [x] Expected 1 space after IF keyword; 0 found
54 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
62 | ERROR | [x] Parameter comment must be on the next line
62 | ERROR | [x] Parameter comment must end with a full stop
63 | ERROR | [x] Parameter comment must be on the next line
64 | ERROR | [x] Parameter comment must be on the next line
65 | ERROR | [x] Separate the @param and @return sections by a blank line.
65 | ERROR | [x] Expected "bool" but found "boolean" for function return type
65 | ERROR | [ ] Description for the @return value is missing
67 | ERROR | [x] Expected 1 space before opening brace; found 0
69 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
92 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 6
92 | ERROR | [x] Object operator not indented correctly; expected 8 spaces but found 6
96 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
102 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
106 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
107 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
109 | ERROR | [x] Expected "bool" but found "boolean" for function return type
109 | ERROR | [ ] Description for the @return value is missing
111 | ERROR | [x] Expected 1 space before opening brace; found 0
118 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
124 | ERROR | [ ] Function return type is void, but function contains return statement
124 | ERROR | [ ] Description for the @return value is missing
126 | ERROR | [x] Expected 1 space before opening brace; found 0
129 | ERROR | [x] Expected 1 space after IF keyword; 0 found
129 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
132 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 39 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.3

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