Problem/Motivation
FILE: modules\follow_me\example_result.php
-----------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 3 WARNINGS AFFECTING 6 LINES
-----------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
4 | ERROR | [x] Array indentation error, expected 2 spaces but found 4
5 | ERROR | [x] Expected 1 space after "=>"; 0 found
9 | WARNING | [x] A comma should follow the last multiline array item. Found: 'node_load'
14 | WARNING | [x] A comma should follow the last multiline array item. Found: 'taxonomy_term_load'
20 | WARNING | [x] A comma should follow the last multiline array item. Found: 'views_get_view'
-----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------
FILE: modules\follow_me\follow_me.module
------------------------------------------------------------------------------------------------------------------------------------
FOUND 10 ERRORS AND 1 WARNING AFFECTING 9 LINES
------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
4 | ERROR | [x] Function comment short description must start with exactly one space
11 | WARNING | [x] Unused use statement
12 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Routing\RouteMatchInterface.
12 | ERROR | [x] There must be one blank line after the last USE statement; 2 found;
18 | ERROR | [x] Expected 1 blank line before function; 2 found
43 | ERROR | [x] Expected 1 blank line after function; 2 found
49 | ERROR | [x] Inline comments must start with a capital letter
49 | ERROR | [x] Whitespace found at end of line
50 | ERROR | [ ] Comment indentation error, expected only 1 spaces
51 | ERROR | [ ] Comment indentation error, expected only 3 spaces
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------
FILE: modules\follow_me\src\ComponentBuilder.php
------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 15 ERRORS AND 5 WARNINGS AFFECTING 16 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
5 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
10 | ERROR | [x] Missing class doc comment
12 | ERROR | [ ] Missing member variable doc comment
21 | ERROR | [ ] Description for the @return value is missing
28 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
34 | WARNING | [x] A comma should follow the last multiline array item. Found: $bundle
44 | ERROR | [ ] Description for the @return value is missing
51 | ERROR | [x] Expected 1 space after IF keyword; 0 found
51 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
57 | WARNING | [x] A comma should follow the last multiline array item. Found: $bundle
66 | ERROR | [ ] Description for the @return value is missing
72 | WARNING | [x] '@TODO Clean up - add validation.' should match the format '@todo Fix problem X here.'
72 | ERROR | [x] No space found before comment text; expected "// @TODO Clean up - add validation." but found "//@TODO Clean up - add validation."
77 | WARNING | [x] '@TODO ...' should match the format '@todo Fix problem X here.'
77 | ERROR | [x] No space found before comment text; expected "// @TODO ..." but found "//@TODO ..."
77 | ERROR | [x] Comments may not appear after statements
78 | WARNING | [x] A comma should follow the last multiline array item. Found: 'views_get_view'
80 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
85 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 15 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: modules\follow_me\src\Constants.php
----------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------------------------------------------------------
7 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
8 | ERROR | [x] There must be exactly one newline after the class comment
12 | ERROR | [ ] Doc comment is empty
18 | ERROR | [ ] Doc comment is empty
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------
FILE: modules\follow_me\src\Controller\FollowMeController.php
-------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
-------------------------------------------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
11 | ERROR | [x] Missing class doc comment
13 | ERROR | [x] Missing function doc comment
17 | WARNING | [x] A comma should follow the last multiline array item. Found: )
22 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------
FILE: modules\follow_me\src\CurrentTrailService.php
--------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 53 ERRORS AND 13 WARNINGS AFFECTING 57 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
6 | WARNING | [x] Unused use statement
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\PathProcessor\OutboundPathProcessorInterface.
10 | WARNING | [x] Unused use statement
11 | WARNING | [x] Unused use statement
12 | WARNING | [x] Unused use statement
12 | ERROR | [x] There must be one blank line after the last USE statement; 2 found;
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
21 | ERROR | [ ] Content missing for @var tag in member variable comment
28 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
35 | ERROR | [ ] Description for the @return value is missing
38 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
39 | ERROR | [ ] Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead
48 | ERROR | [ ] Missing short description in doc comment
49 | ERROR | [ ] Description for the @return value is missing
53 | WARNING | [x] '@TODO: Clean up (create as method).' should match the format '@todo Fix problem X here.'
55 | ERROR | [x] Concat operator must be surrounded by a single space
64 | ERROR | [ ] Missing short description in doc comment
65 | ERROR | [ ] Description for the @return value is missing
76 | ERROR | [x] Short array syntax must be used to define arrays
82 | ERROR | [ ] Comment indentation error, expected only 1 spaces
83 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
89 | ERROR | [x] Concat operator must be surrounded by a single space
94 | ERROR | [x] There should be no white space after an opening "("
94 | ERROR | [x] There should be no white space before a closing ")"
102 | ERROR | [x] Expected 1 space after "="; 0 found
107 | ERROR | [x] Expected newline after closing brace
116 | ERROR | [x] Expected 1 blank line after function; 2 found
119 | ERROR | [ ] Missing short description in doc comment
120 | ERROR | [ ] Missing parameter comment
122 | ERROR | [ ] Description for the @return value is missing
127 | ERROR | [x] Concat operator must be surrounded by a single space
129 | ERROR | [x] Inline comments must start with a capital letter
129 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
130 | ERROR | [x] Expected 1 space after IF keyword; 0 found
132 | ERROR | [x] Expected newline after closing brace
141 | ERROR | [ ] Missing short description in doc comment
142 | ERROR | [ ] Missing parameter comment
144 | ERROR | [ ] Description for the @return value is missing
150 | ERROR | [x] Expected 1 blank line after function; 3 found
153 | ERROR | [ ] More than 2 empty lines are not allowed
157 | ERROR | [ ] Description for the @return value is missing
163 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
167 | ERROR | [x] Inline comments must start with a capital letter
171 | ERROR | [x] Inline comments must start with a capital letter
175 | ERROR | [x] Inline comments must start with a capital letter
186 | ERROR | [ ] Description for the @return value is missing
193 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
199 | WARNING | [x] A comma should follow the last multiline array item. Found: $bundle
209 | ERROR | [ ] Description for the @return value is missing
216 | ERROR | [x] Expected 1 space after IF keyword; 0 found
216 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
222 | WARNING | [x] A comma should follow the last multiline array item. Found: $bundle
231 | ERROR | [ ] Description for the @return value is missing
237 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
237 | ERROR | [x] 4 spaces found before inline comment; expected "// $view_id =$route->getDefault('view_id');" but found "// $view_id =$route->getDefault('view_id');"
238 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
239 | WARNING | [x] There must be no blank line following an inline comment
239 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 0
241 | WARNING | [x] '@TODO Clean up - add validation.' should match the format '@todo Fix problem X here.'
241 | ERROR | [x] No space found before comment text; expected "// @TODO Clean up - add validation." but found "//@TODO Clean up - add validation."
246 | WARNING | [x] '@TODO ...' should match the format '@todo Fix problem X here.'
246 | ERROR | [x] No space found before comment text; expected "// @TODO ..." but found "//@TODO ..."
246 | ERROR | [x] Comments may not appear after statements
247 | WARNING | [x] A comma should follow the last multiline array item. Found: 'views_get_view'
--------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 45 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: modules\follow_me\src\EventSubscriber\FollowMeSubscriber.php
-------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 1 WARNING AFFECTING 8 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
3 | ERROR | [ ] Doc comment is empty
10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Symfony\Component\EventDispatcher\EventSubscriberInterface.
10 | ERROR | [x] There must be one blank line after the last USE statement; 2 found;
15 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
29 | ERROR | [ ] Public method name "FollowMeSubscriber::getTrailID" is not in lowerCamel format
47 | ERROR | [ ] Description for the @return value is missing
49 | ERROR | [ ] Public method name "FollowMeSubscriber::generateTrailID" is not in lowerCamel format
54 | ERROR | [x] Expected newline after closing brace
62 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 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.