Fix the issues reported by PHP_CodeSniffer

Created on 30 September 2024, about 2 months ago

Problem/Motivation

FILE: modules\ops\ops.libraries.yml
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
5 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: modules\ops\ops.links.menu.yml
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
5 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: modules\ops\ops.module
----------------------------------------------------------------------------------
FOUND 9 ERRORS AND 1 WARNING AFFECTING 10 LINES
----------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
3 | ERROR | [x] Missing function doc comment
6 | ERROR | [x] Short array syntax must be used to define arrays
7 | ERROR | [x] Short array syntax must be used to define arrays
8 | ERROR | [x] Short array syntax must be used to define arrays
9 | WARNING | [x] A comma should follow the last multiline array item. Found: )
13 | ERROR | [x] Missing function doc comment
15 | ERROR | [x] Expected 1 space after "="; 2 found
16 | ERROR | [x] Whitespace found at end of line
20 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------

FILE: modules\ops\ops.routing.yml
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
7 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: modules\ops\README.txt
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
4 | WARNING | Line exceeds 80 characters; contains 81 characters
13 | WARNING | Line exceeds 80 characters; contains 125 characters
----------------------------------------------------------------------

FILE: modules\ops\src\Form\onPageSearchSetting.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 23 ERRORS AND 3 WARNINGS AFFECTING 24 LINES
------------------------------------------------------------------------------------------------------------------------------
11 | ERROR | [ ] Class name must begin with a capital letter
12 | ERROR | [x] Whitespace found at end of line
15 | ERROR | [x] Expected 1 blank line before function; 0 found
19 | ERROR | [x] Whitespace found at end of line
28 | ERROR | [x] Whitespace found at end of line
34 | ERROR | [x] Short array syntax must be used to define arrays
38 | WARNING | [x] A comma should follow the last multiline array item. Found: )
40 | ERROR | [x] Whitespace found at end of line
41 | ERROR | [x] Short array syntax must be used to define arrays
45 | WARNING | [x] A comma should follow the last multiline array item. Found: )
47 | ERROR | [x] Whitespace found at end of line
48 | ERROR | [x] Short array syntax must be used to define arrays
52 | WARNING | [x] A comma should follow the last multiline array item. Found: )
53 | ERROR | [x] Whitespace found at end of line
58 | ERROR | [x] Whitespace found at end of line
62 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
62 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
63 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
64 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
65 | ERROR | [x] Object operator not indented correctly; expected 8 spaces but found 6
72 | ERROR | [x] Whitespace found at end of line
73 | ERROR | [x] Whitespace found at end of line
79 | ERROR | [x] Expected 1 space after IF keyword; 0 found
82 | ERROR | [x] Expected 1 space after IF keyword; 0 found
86 | ERROR | [x] Expected 1 newline at end of file; 0 found
86 | ERROR | [x] The closing brace for the class must have an empty line before it
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 25 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------

FILE: modules\ops\src\Plugin\Block\OnPageSearch.php
-----------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
27 | ERROR | [x] Short array syntax must be used to define arrays
29 | ERROR | [x] Short array syntax must be used to define arrays
30 | ERROR | [x] Short array syntax must be used to define arrays
-----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 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

8.2

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