Coding standards

Created on 29 November 2024, 23 days ago

Problem/Motivation

FILE: ...cards/src/Plugin/Field/FieldFormatter/CardChildrenFieldFormatter.php
--------------------------------------------------------------------------------------------------------------------------------------FOUND 56 ERRORS AND 6 WARNINGS AFFECTING 50 LINES
-------------------------------------------------------------------------------------------------------------------------------------- 7 | WARNING | [x] Unused use statement
8 | WARNING | [x] Unused use statement
8 | ERROR | [x] There must be one blank line after the last USE statement; 2 found;
31 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
32 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
33 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
33 | ERROR | [ ] Comment indentation error, expected only 4 spaces
34 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
35 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
35 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
36 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
37 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
38 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
39 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
40 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
41 | WARNING | [ ] Line exceeds 80 characters; contains 145 characters
41 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
42 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
43 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
44 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
45 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
45 | ERROR | [ ] Comment indentation error, expected only 6 spaces
46 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
47 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
48 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
49 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
50 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
50 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
50 | ERROR | [ ] Comment indentation error, expected only 6 spaces
51 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
52 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
53 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
54 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
55 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
56 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
57 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
58 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
59 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
59 | ERROR | [ ] Comment indentation error, expected only 6 spaces
60 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
60 | ERROR | [ ] Comment indentation error, expected only 10 spaces
61 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
62 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
63 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
63 | ERROR | [ ] Comment indentation error, expected only 8 spaces
64 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
65 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
66 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
66 | ERROR | [ ] Comment indentation error, expected only 12 spaces
67 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
68 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
69 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
70 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
71 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
72 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
73 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
74 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
75 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
76 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
77 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
78 | WARNING | [x] There must be no blank line following an inline comment
78 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
--------------------------------------------------------------------------------------------------------------------------------------PHPCBF CAN FIX THE 52 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------

FILE: ...cards/src/Plugin/Field/FieldFormatter/CardFieldFormatter.php
--------------------------------------------------------------------------------------------------------------------------------------FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------- 33 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 10
--------------------------------------------------------------------------------------------------------------------------------------PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------

FILE: ...cards/src/Plugin/Field/FieldType/CardFieldType.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 13 ERRORS AND 1 WARNING AFFECTING 12 LINES
-------------------------------------------------------------------------------------------------------------------------------
3 | ERROR | [x] There must be one blank line after the namespace declaration
23 | ERROR | [x] Additional blank lines found at end of doc comment
38 | ERROR | [x] Missing function doc comment
42 | WARNING | [x] There must be no blank line following an inline comment
45 | ERROR | [x] Expected 1 space after "="; 2 found
45 | ERROR | [x] Expected one space after the comma, 0 found
46 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
49 | ERROR | [x] Expected 1 blank line after function; 2 found
52 | ERROR | [x] Missing function doc comment
55 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
58 | ERROR | [x] Expected 1 space after "="; 2 found
58 | ERROR | [x] Expected one space after the comma, 0 found
59 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
65 | ERROR | [x] Missing function doc comment
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------

FILE: ...cards/src/Plugin/Field/FieldType/CardChildrenFieldType.php
--------------------------------------------------------------------------------------------------------------------------------------FOUND 0 ERRORS AND 8 WARNINGS AFFECTING 8 LINES
-------------------------------------------------------------------------------------------------------------------------------------- 5 | WARNING | [x] Unused use statement
6 | WARNING | [x] Unused use statement
7 | WARNING | [x] Unused use statement
8 | WARNING | [x] Unused use statement
9 | WARNING | [x] Unused use statement
10 | WARNING | [x] Unused use statement
11 | WARNING | [x] Unused use statement
12 | WARNING | [x] Unused use statement
--------------------------------------------------------------------------------------------------------------------------------------PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------

FILE: ...cards/src/Plugin/Field/FieldType/CardViewTrait.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 13 ERRORS AFFECTING 12 LINES
-------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
11 | ERROR | [x] Missing trait doc comment
122 | ERROR | [x] Expected 1 blank line after function; 3 found
125 | ERROR | [ ] More than 2 empty lines are not allowed
137 | ERROR | [x] Use null coalesce operator instead of ternary operator.
138 | ERROR | [x] Use null coalesce operator instead of ternary operator.
139 | ERROR | [x] Use null coalesce operator instead of ternary operator.
140 | ERROR | [x] Use null coalesce operator instead of ternary operator.
141 | ERROR | [x] Use null coalesce operator instead of ternary operator.
142 | ERROR | [x] Use null coalesce operator instead of ternary operator.
254 | ERROR | [x] Expected 1 blank line after function; 2 found
257 | ERROR | [x] Expected 1 newline at end of file; 2 found
257 | ERROR | [x] The closing brace for the trait must have an empty line before it
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------

FILE: ...cards/src/Plugin/Field/FieldWidget/CardWidgetTrait.php
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 31 ERRORS AFFECTING 26 LINES
-----------------------------------------------------------------------------------------------------------------------------------
3 | ERROR | [x] There must be one blank line after the namespace declaration
6 | ERROR | [ ] More than 2 empty lines are not allowed
7 | ERROR | [ ] More than 2 empty lines are not allowed
8 | ERROR | [ ] More than 2 empty lines are not allowed
11 | ERROR | [x] Missing trait doc comment
15 | ERROR | [x] Missing function doc comment
15 | ERROR | [x] The first parameter of a multi-line function declaration must be on the line after the opening bracket
16 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 30
17 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 30
18 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 30
19 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 30
19 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
19 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line
20 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
30 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
43 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
44 | ERROR | [x] There should be no white space after an opening "["
44 | ERROR | [x] The first index in a multi-value array must be on a new line
49 | ERROR | [x] Array indentation error, expected 8 spaces but found 10
51 | ERROR | [x] Closing parenthesis of array declaration must be on a new line
70 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
72 | ERROR | [x] Use null coalesce operator instead of ternary operator.
90 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
92 | ERROR | [x] Use null coalesce operator instead of ternary operator.
111 | ERROR | [x] Use null coalesce operator instead of ternary operator.
134 | ERROR | [x] Use null coalesce operator instead of ternary operator.
156 | ERROR | [x] Use null coalesce operator instead of ternary operator.
178 | ERROR | [x] Use null coalesce operator instead of ternary operator.
186 | ERROR | [x] Expected 1 blank line after function; 0 found
187 | ERROR | [x] Expected 1 newline at end of file; 2 found
187 | ERROR | [x] The closing brace for the trait must have an empty line before it
-----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 28 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------

FILE: ...cards/src/Plugin/Field/FieldWidget/CardFieldWidget.php
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------------------------------------
3 | ERROR | [x] There must be one blank line after the namespace declaration
9 | WARNING | [x] Unused use statement
9 | ERROR | [x] Non-namespaced classes/interfaces/traits should not be referenced with use statements
35 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
-----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------

FILE: ...cards/src/Plugin/Field/FieldWidget/CardChildrenFieldWidget.php
--------------------------------------------------------------------------------------------------------------------------------------FOUND 6 ERRORS AND 2 WARNINGS AFFECTING 7 LINES
-------------------------------------------------------------------------------------------------------------------------------------- 3 | ERROR | [x] There must be one blank line after the namespace declaration
8 | WARNING | [x] Unused use statement
8 | ERROR | [x] There must be one blank line after the last USE statement; 2 found;
25 | ERROR | [x] Missing function doc comment
30 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
36 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
39 | ERROR | [x] Expected 1 blank line after function; 0 found
40 | ERROR | [x] The closing brace for the class must have an empty line before it
--------------------------------------------------------------------------------------------------------------------------------------PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------
Time: 193ms; Memory: 10MB

Steps to reproduce

In the root of the module run phpcs.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

3.0

Component

Code

Created by

🇨🇴Colombia kinyein

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