Problem/Motivation
Getting Following errors/warnings
$ phpcs --standard=Drupal gdpr_alert
FILE: C:\Users\Admin\Desktop\task\gdpr_alert\css\gdpr_alert.css
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found
| | "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: C:\Users\Admin\Desktop\task\gdpr_alert\js\gdpr_alert.js
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found
| | "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: C:\Users\Admin\Desktop\task\gdpr_alert\src\Form\GDPRAlertConfigForm.php
--------------------------------------------------------------------------------
FOUND 18 ERRORS AND 2 WARNINGS AFFECTING 20 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found
| | "\r\n"
15 | ERROR | [x] Doc comment short description must end with a full stop
18 | WARNING | [ ] The class short comment should describe what the class
| | does and not simply repeat the class name
21 | ERROR | [ ] Missing short description in doc comment
26 | ERROR | [ ] Missing short description in doc comment
31 | ERROR | [ ] Missing short description in doc comment
39 | ERROR | [ ] Missing parameter comment
40 | ERROR | [ ] Missing parameter comment
41 | ERROR | [ ] Missing parameter comment
54 | ERROR | [ ] Missing short description in doc comment
55 | ERROR | [ ] Missing parameter comment
68 | ERROR | [ ] Doc comment short description must start with a capital
| | letter
84 | ERROR | [ ] Description for the @return value is missing
102 | ERROR | [ ] Missing parameter comment
165 | WARNING | [ ] Possible useless method overriding detected
177 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
180 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
189 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
191 | ERROR | [x] Expected 1 blank line after function; 0 found
192 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: C:\Users\Admin\Desktop\task\gdpr_alert\src\Form\GDPRAlertSettingsForm.php
--------------------------------------------------------------------------------
FOUND 18 ERRORS AND 2 WARNINGS AFFECTING 20 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found
| | "\r\n"
14 | ERROR | [x] Doc comment short description must end with a full stop
17 | WARNING | [ ] The class short comment should describe what the class
| | does and not simply repeat the class name
20 | ERROR | [ ] Missing short description in doc comment
25 | ERROR | [ ] Missing short description in doc comment
33 | ERROR | [ ] Missing parameter comment
34 | ERROR | [ ] Missing parameter comment
35 | ERROR | [ ] Missing parameter comment
39 | ERROR | [x] Expected 1 space between type hint and argument
| | "$cache_factory"; 2 found
40 | ERROR | [x] Expected 1 space between type hint and argument "$state";
| | 9 found
47 | ERROR | [ ] Missing short description in doc comment
48 | ERROR | [ ] Missing parameter comment
61 | ERROR | [ ] Doc comment short description must start with a capital
| | letter
77 | ERROR | [ ] Description for the @return value is missing
92 | ERROR | [ ] Missing parameter comment
156 | WARNING | [ ] Possible useless method overriding detected
167 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
174 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
176 | ERROR | [x] Expected 1 blank line after function; 0 found
177 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: C:\Users\Admin\Desktop\task\gdpr_alert\src\Plugin\Block\GDPRAlertBlock.php
--------------------------------------------------------------------------------
FOUND 21 ERRORS AFFECTING 18 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found
| | "\r\n"
15 | ERROR | [x] Doc comment short description must end with a full stop
25 | ERROR | [ ] Missing short description in doc comment
30 | ERROR | [ ] Missing short description in doc comment
35 | ERROR | [ ] Missing short description in doc comment
41 | ERROR | [x] Doc comment short description must end with a full stop
47 | ERROR | [ ] Missing short description in doc comment
55 | ERROR | [ ] Missing parameter comment
56 | ERROR | [ ] Missing parameter comment
56 | ERROR | [ ] Missing parameter type
57 | ERROR | [ ] Missing parameter comment
57 | ERROR | [ ] Missing parameter type
58 | ERROR | [ ] Missing parameter comment
59 | ERROR | [ ] Missing parameter comment
60 | ERROR | [ ] Missing parameter comment
61 | ERROR | [ ] Missing parameter comment
98 | ERROR | [ ] Description for the @return value is missing
131 | ERROR | [x] Concat operator must be surrounded by a single space
131 | ERROR | [x] Concat operator must be surrounded by a single space
159 | ERROR | [x] Expected 1 blank line after function; 0 found
160 | 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: 494ms; Memory: 8MB
Proposed resolution
Fix the errors and warnings.