Fix the issues reported by phpcs

Created on 30 December 2022, almost 2 years ago
Updated 27 June 2023, over 1 year ago

Problem/Motivation

The Drupal coding standards apply to code within Drupal and its contributed modules
Base on version 8.x-1.x-dev

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/views_ical/views_ical.install
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
8 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
8 | ERROR | [x] 2 spaces found before inline comment; expected "// \Drupal::configFactory()->getEditable('core.date_format')->clear('views_ical')->delete();" but found "//
| | \Drupal::configFactory()->getEditable('core.date_format')->clear('views_ical')->delete();"
9 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/views_ical/README.md
---------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 14 WARNINGS AFFECTING 14 LINES
---------------------------------------------------------------------------------------------
15 | WARNING | Line exceeds 80 characters; contains 99 characters
17 | WARNING | Line exceeds 80 characters; contains 111 characters
19 | WARNING | Line exceeds 80 characters; contains 114 characters
20 | WARNING | Line exceeds 80 characters; contains 88 characters
24 | WARNING | Line exceeds 80 characters; contains 120 characters
25 | WARNING | Line exceeds 80 characters; contains 119 characters
27 | WARNING | Line exceeds 80 characters; contains 119 characters
28 | WARNING | Line exceeds 80 characters; contains 120 characters
33 | WARNING | Line exceeds 80 characters; contains 118 characters
35 | WARNING | Line exceeds 80 characters; contains 107 characters
36 | WARNING | Line exceeds 80 characters; contains 113 characters
37 | WARNING | Line exceeds 80 characters; contains 113 characters
45 | WARNING | Line exceeds 80 characters; contains 202 characters
47 | WARNING | Line exceeds 80 characters; contains 94 characters
---------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/views_ical/views_ical.module
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 30 WARNINGS AFFECTING 35 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
49 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
51 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
52 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
53 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
54 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
55 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
56 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
59 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
60 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
62 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
64 | WARNING | [x] 'TODO: Need to load library' should match the format '@todo Fix problem X here.'
64 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
65 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
66 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
69 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
70 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
72 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
73 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
76 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
77 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 3 empty lines
79 | ERROR | [ ] More than 2 empty lines are not allowed
80 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
80 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
81 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
83 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
84 | WARNING | [ ] Line exceeds 80 characters; contains 89 characters
84 | ERROR | [x] No space found before comment text; expected "// $view->getResponse()->headers->set('Content-Type', 'text/calendar; charset=utf-8');" but found
| | "//$view->getResponse()->headers->set('Content-Type', 'text/calendar; charset=utf-8');"
85 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
86 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
87 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
88 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
91 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
92 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
94 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
95 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
99 | WARNING | [ ] Code after the RETURN statement on line 47 cannot be executed
100 | ERROR | [x] Expected 1 blank line after function; 2 found
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/views_ical/src/Plugin/views/style/IcalWizard.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 43 ERRORS AND 9 WARNINGS AFFECTING 44 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Url.
12 | WARNING | [x] Unused use statement
15 | WARNING | [x] Unused use statement
15 | ERROR | [x] There must be one blank line after the last USE statement; 2 found;
19 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
33 | ERROR | [ ] Missing member variable doc comment
34 | ERROR | [ ] Missing member variable doc comment
35 | ERROR | [ ] Missing member variable doc comment
95 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
109 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
116 | ERROR | [x] Short array syntax must be used to define arrays
125 | ERROR | [x] Short array syntax must be used to define arrays
133 | ERROR | [x] Short array syntax must be used to define arrays
136 | WARNING | [ ] Line exceeds 80 characters; contains 99 characters
136 | WARNING | [x] 'TODO: Filter out only boolean fields. Allow this to be empty.' should match the format '@todo Fix problem X here.'
136 | ERROR | [x] Comments may not appear after statements
136 | ERROR | [x] No space found before comment text; expected "// TODO: Filter out only boolean fields. Allow this to be empty." but found "//TODO: Filter out only boolean fields. Allow this to be
| | empty."
141 | ERROR | [x] Short array syntax must be used to define arrays
144 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
147 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
149 | ERROR | [x] Short array syntax must be used to define arrays
157 | ERROR | [x] Short array syntax must be used to define arrays
165 | ERROR | [x] Short array syntax must be used to define arrays
173 | ERROR | [x] Short array syntax must be used to define arrays
181 | ERROR | [x] Short array syntax must be used to define arrays
184 | WARNING | [x] 'TODO: Filter out only boolean fields.' should match the format '@todo Fix problem X here.'
184 | ERROR | [x] Comments may not appear after statements
184 | ERROR | [x] No space found before comment text; expected "// TODO: Filter out only boolean fields." but found "//TODO: Filter out only boolean fields."
192 | ERROR | [ ] The array declaration extends to column 94 (the limit is 80). The array content should be split up over multiple lines
194 | WARNING | [ ] Avoid backslash escaping in translatable strings when possible, use "" quotes instead
196 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
200 | ERROR | [x] Missing function doc comment
219 | ERROR | [x] Expected 1 blank line after function; 2 found
222 | ERROR | [ ] Missing short description in doc comment
223 | ERROR | [ ] Description for the @return value is missing
225 | ERROR | [x] Expected 1 space before opening brace; found 0
229 | ERROR | [x] Missing function doc comment
231 | ERROR | [x] Expected 1 blank line after function; 2 found
250 | WARNING | [ ] Unused variable $parent_render.
251 | ERROR | [x] Whitespace found at end of line
261 | ERROR | [x] Expected 1 space after "="; 2 found
262 | ERROR | [x] Line indented incorrectly; expected at least 4 spaces, found 0
262 | ERROR | [x] 6 spaces found before inline comment; expected "// '#markup' => $render," but found "// '#markup' => $render,"
264 | ERROR | [x] No space found before comment text; expected "// '#theme' => $this->themeFunctions()," but found "//'#theme' => $this->themeFunctions(),"
265 | ERROR | [x] No space found before comment text; expected "// '#view' => $this->view," but found "//'#view' => $this->view,"
266 | ERROR | [x] No space found before comment text; expected "// '#options' => $this->options," but found "//'#options' => $this->options,"
267 | ERROR | [x] No space found before comment text; expected "// '#rows' => $parent_render," but found "//'#rows' => $parent_render,"
270 | ERROR | [x] Comments may not appear after statements
270 | ERROR | [x] No space found before comment text; expected "// What is this doing?" but found "//What is this doing?"
272 | ERROR | [x] Expected 1 blank line after function; 2 found
275 | ERROR | [x] Missing function doc comment
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 42 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/views_ical/src/Plugin/views/style/Ical.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 1 WARNING AFFECTING 8 LINES
------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Url.
22 | ERROR | [ ] Missing member variable doc comment
23 | ERROR | [ ] Missing member variable doc comment
24 | ERROR | [ ] Missing member variable doc comment
25 | ERROR | [ ] Missing member variable doc comment
27 | ERROR | [x] Missing function doc comment
57 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
67 | WARNING | [ ] Unused variable $build.
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/views_ical/src/Plugin/views/row/IcalFieldsWizard.php
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 84 ERRORS AND 28 WARNINGS AFFECTING 89 LINES
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
12 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\ContentEntityInterface.
14 | WARNING | [x] Unused use statement
15 | WARNING | [x] Unused use statement
16 | WARNING | [x] Unused use statement
19 | WARNING | [x] Unused use statement
22 | WARNING | [x] Unused use statement
22 | ERROR | [x] There must be one blank line after the last USE statement; 2 found;
26 | ERROR | [x] Doc comment short description must end with a full stop
43 | ERROR | [ ] Missing short description in doc comment
50 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
59 | WARNING | [ ] Unused variable $renderer.
63 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 5
67 | ERROR | [x] Expected 1 space after IF keyword; 0 found
70 | ERROR | [ ] Function return type is not void, but function is returning void here
74 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
76 | ERROR | [x] No space found before comment text; expected "// $date_field = $this->view->field[$options['date_field']];" but found "//$date_field = $this->view->field[$options['date_field']];"
94 | WARNING | [x] There must be no blank line following an inline comment
94 | WARNING | [ ] There must be no blank line following an inline comment
94 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
102 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
103 | ERROR | [x] Use "elseif" in place of "else if"
103 | ERROR | [x] Expected 1 space after IF keyword; 0 found
107 | ERROR | [x] Use "elseif" in place of "else if"
108 | WARNING | [x] 'TODO: are date ranges separate date field types?' should match the format '@todo Fix problem X here.'
113 | ERROR | [x] Use "elseif" in place of "else if"
116 | ERROR | [x] Use "elseif" in place of "else if"
116 | ERROR | [x] Expected 1 space after IF keyword; 0 found
129 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
136 | ERROR | [x] Use null coalesce operator instead of ternary operator.
157 | ERROR | [x] Expected 1 space after asterisk; 2 found
157 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 2 spaces
158 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 4 spaces
160 | ERROR | [x] Parameter comment indentation must be 3 spaces, found 1 spaces
166 | ERROR | [x] Expected 1 space after IF keyword; 0 found
171 | ERROR | [x] Expected 1 space after IF keyword; 0 found
174 | WARNING | [ ] Line exceeds 80 characters; contains 92 characters
182 | ERROR | [x] Expected 1 space after IF keyword; 0 found
183 | ERROR | [x] Expected 1 space after "="; 2 found
186 | ERROR | [x] Expected 1 space after "="; 2 found
192 | ERROR | [x] Expected 1 space before "="; 0 found
198 | ERROR | [x] Use "elseif" in place of "else if"
198 | ERROR | [x] Expected 1 space after IF keyword; 0 found
205 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
212 | WARNING | [ ] Line exceeds 80 characters; contains 100 characters
212 | WARNING | [x] 'TODO: We repeat something similar to this 3 times. I like my code like I like my wine, DRY.' should match the format '@todo Fix problem X here.'
226 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
263 | WARNING | [ ] Unused variable $key.
271 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
293 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
305 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
321 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
334 | WARNING | [ ] Line exceeds 80 characters; contains 91 characters
336 | ERROR | [x] Inline control structures are not allowed
336 | ERROR | [x] Expected 1 space after IF keyword; 0 found
338 | ERROR | [x] Inline control structures are not allowed
338 | ERROR | [x] Expected 1 space after ELSE keyword; newline found
347 | ERROR | [ ] Parameter $row is not described in comment
350 | ERROR | [ ] Missing parameter comment
351 | ERROR | [ ] Missing parameter comment
351 | ERROR | [ ] Doc comment for parameter $entity does not match actual variable name $field_mapping
352 | ERROR | [ ] Missing parameter comment
353 | ERROR | [ ] Missing parameter comment
360 | WARNING | [ ] Unused variable $datefield_values.
362 | WARNING | [x] 'TODO: make these separate functions' should match the format '@todo Fix problem X here.'
367 | ERROR | [x] Inline comments must start with a capital letter
370 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
376 | WARNING | [ ] Line exceeds 80 characters; contains 93 characters
385 | ERROR | [x] Expected 1 space after IF keyword; 0 found
385 | WARNING | [ ] Unused variable $date_all_day.
385 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
386 | WARNING | [x] 'TODO: implement' should match the format '@todo Fix problem X here.'
386 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
392 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
397 | ERROR | [x] No space found before comment text; expected "// else {" but found "//else {"
397 | ERROR | [x] Inline comments must start with a capital letter
401 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
402 | WARNING | [x] There must be no blank line following an inline comment
402 | WARNING | [ ] There must be no blank line following an inline comment
402 | ERROR | [x] No space found before comment text; expected "// }" but found "//}"
406 | ERROR | [x] Expected 1 blank line after function; 2 found
409 | ERROR | [ ] Parameter $row is not described in comment
410 | ERROR | [x] Doc comment short description must end with a full stop
412 | ERROR | [ ] Missing parameter comment
413 | ERROR | [ ] Missing parameter comment
413 | ERROR | [ ] Doc comment for parameter $entity does not match actual variable name $field_mapping
414 | ERROR | [ ] Missing parameter comment
415 | ERROR | [ ] Missing parameter comment
428 | ERROR | [x] Inline comments must start with a capital letter
428 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
431 | ERROR | [x] Inline comments must start with a capital letter
438 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
455 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
457 | ERROR | [x] Expected 1 blank line after function; 2 found
523 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
531 | WARNING | [x] A comma should follow the last multiline array item. Found: 'SECONDLY'
559 | ERROR | [x] Expected 1 blank line after function; 4 found
562 | ERROR | [ ] More than 2 empty lines are not allowed
563 | ERROR | [ ] More than 2 empty lines are not allowed
572 | WARNING | [ ] Unused variable $index.
594 | WARNING | [ ] Line exceeds 80 characters; contains 97 characters
611 | ERROR | [ ] Missing parameter comment
612 | ERROR | [x] Separate the @param and @return sections by a blank line.
612 | ERROR | [ ] Description for the @return value is missing
616 | WARNING | [ ] Line exceeds 80 characters; contains 85 characters
616 | WARNING | [x] 'TODO, Change how this is being accessed so it's not using private properties' should match the format '@todo Fix problem X here.'
616 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
619 | ERROR | [x] Use "elseif" in place of "else if"
632 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
632 | ERROR | [ ] Description for the @return value is missing
640 | ERROR | [x] Expected 1 blank line after function; 0 found
641 | ERROR | [x] The closing brace for the class must have an empty line before it
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 77 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/views_ical/src/Plugin/views/row/IcalFields.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------
3 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
13 | ERROR | [x] Doc comment short description must end with a full stop
-----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/views_ical/src/Plugin/views/display/IcalDisplay.php
----------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
----------------------------------------------------------------------------------------------------------------------------
56 | ERROR | [x] Short array syntax must be used to define arrays
64 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
83 | ERROR | [ ] Missing parameter type
85 | ERROR | [x] Separate the @param and @return sections by a blank line.
125 | ERROR | [x] Missing function doc comment
----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/views_ical/src/ViewsIcalHelper.php
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 113 ERRORS AND 32 WARNINGS AFFECTING 108 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
6 | WARNING | [x] Unused use statement
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\views\ResultRow.
15 | ERROR | [ ] Missing member variable doc comment
18 | ERROR | [ ] Missing short description in doc comment
19 | ERROR | [ ] Missing parameter comment
19 | ERROR | [ ] Missing parameter type
21 | ERROR | [x] Expected 1 blank line before function; 2 found
21 | ERROR | [x] Expected 1 space before opening brace; found 0
23 | ERROR | [x] Expected 1 blank line after function; 2 found
49 | ERROR | [x] Expected 1 space after IF keyword; 0 found
54 | ERROR | [x] Expected 1 space after IF keyword; 0 found
57 | WARNING | [ ] Line exceeds 80 characters; contains 92 characters
62 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
63 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
67 | ERROR | [x] Expected 1 space after IF keyword; 0 found
68 | ERROR | [x] Expected 1 space after "="; 2 found
68 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
71 | ERROR | [x] Expected 1 space after "="; 2 found
71 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
77 | ERROR | [x] Expected 1 space before "="; 0 found
83 | ERROR | [x] Use "elseif" in place of "else if"
83 | ERROR | [x] Expected 1 space after IF keyword; 0 found
90 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
118 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
131 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
144 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
163 | ERROR | [ ] Parameter $row is not described in comment
166 | ERROR | [ ] Missing parameter comment
167 | ERROR | [ ] Missing parameter comment
167 | ERROR | [ ] Doc comment for parameter $entity does not match actual variable name $field_mapping
168 | ERROR | [ ] Missing parameter comment
169 | ERROR | [ ] Missing parameter comment
173 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
176 | WARNING | [ ] Unused variable $datefield_values.
178 | WARNING | [x] 'TODO: make these separate functions' should match the format '@todo Fix problem X here.'
183 | ERROR | [x] Inline comments must start with a capital letter
186 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
191 | WARNING | [ ] Line exceeds 80 characters; contains 93 characters
199 | ERROR | [x] Expected 1 space after IF keyword; 0 found
199 | WARNING | [ ] Unused variable $date_all_day.
199 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
200 | WARNING | [x] 'TODO: implement' should match the format '@todo Fix problem X here.'
200 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
206 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
211 | ERROR | [x] No space found before comment text; expected "// else {" but found "//else {"
211 | ERROR | [x] Inline comments must start with a capital letter
215 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
216 | WARNING | [x] There must be no blank line following an inline comment
216 | WARNING | [ ] There must be no blank line following an inline comment
216 | ERROR | [x] No space found before comment text; expected "// }" but found "//}"
220 | ERROR | [x] Expected 1 blank line after function; 2 found
223 | ERROR | [ ] Parameter $row is not described in comment
224 | ERROR | [x] Doc comment short description must end with a full stop
226 | ERROR | [ ] Missing parameter comment
227 | ERROR | [ ] Missing parameter comment
227 | ERROR | [ ] Doc comment for parameter $entity does not match actual variable name $field_mapping
228 | ERROR | [ ] Missing parameter comment
229 | ERROR | [ ] Missing parameter comment
233 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
242 | ERROR | [x] Inline comments must start with a capital letter
242 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
245 | ERROR | [x] Inline comments must start with a capital letter
251 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
267 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
276 | ERROR | [x] Expected 1 blank line after function; 4 found
279 | ERROR | [ ] More than 2 empty lines are not allowed
280 | ERROR | [ ] More than 2 empty lines are not allowed
289 | WARNING | [ ] Unused variable $index.
311 | ERROR | [ ] Parameter $entity is not described in comment
312 | ERROR | [x] Doc comment short description must end with a full stop
314 | ERROR | [ ] Missing parameter comment
314 | ERROR | [ ] Missing parameter type
315 | ERROR | [ ] Missing parameter comment
315 | ERROR | [ ] Doc comment for parameter $row_index does not match actual variable name $entity
316 | ERROR | [x] Separate the @param and @return sections by a blank line.
316 | ERROR | [ ] Description for the @return value is missing
320 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
322 | WARNING | [ ] Unused variable $email_auth.
322 | ERROR | [x] Short array syntax must be used to define arrays
325 | ERROR | [x] Expected 1 blank line after function; 2 found
328 | ERROR | [ ] Parameter $datetime is not described in comment
329 | WARNING | [ ] Line exceeds 80 characters; contains 105 characters
330 | WARNING | [ ] Line exceeds 80 characters; contains 123 characters
330 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
332 | WARNING | [ ] Line exceeds 80 characters; contains 99 characters
333 | ERROR | [x] Doc comment long description must end with a full stop
334 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
334 | ERROR | [ ] Missing parameter comment
334 | ERROR | [ ] Missing parameter type
335 | ERROR | [x] Separate the @param and @return sections by a blank line.
335 | ERROR | [ ] Description for the @return value is missing
336 | ERROR | [x] Separate the @return and @throws sections by a blank line.
349 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
353 | WARNING | [ ] Line exceeds 80 characters; contains 121 characters
357 | WARNING | [ ] Line exceeds 80 characters; contains 161 characters
359 | ERROR | [x] Space after closing parenthesis of function call prohibited
359 | ERROR | [x] Space found before semicolon; expected ");" but found ") ;"
362 | WARNING | [ ] Line exceeds 80 characters; contains 121 characters
363 | ERROR | [x] Expected 1 space after "-"; 0 found
365 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
368 | ERROR | [x] Expected 1 space after WHILE keyword; 0 found
372 | ERROR | [x] Expected 1 space before "+"; 0 found
372 | ERROR | [x] Expected 1 space after "+"; 0 found
373 | ERROR | [x] Expected 1 space before "+"; 0 found
373 | ERROR | [x] Expected 1 space after "+"; 0 found
376 | WARNING | [ ] Line exceeds 80 characters; contains 119 characters
378 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
379 | ERROR | [x] Expected 1 space before "-"; 0 found
379 | ERROR | [x] Expected 1 space after "-"; 0 found
384 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
386 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
391 | ERROR | [x] Use "elseif" in place of "else if"
392 | WARNING | [ ] Line exceeds 80 characters; contains 99 characters
392 | ERROR | [x] Inline comments must start with a capital letter
409 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
412 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
417 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
419 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
419 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
422 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
422 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
429 | WARNING | [ ] Line exceeds 80 characters; contains 95 characters
430 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
433 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
437 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
437 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
440 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
440 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
453 | ERROR | [ ] Parameter $offset is not described in comment
454 | WARNING | [ ] Line exceeds 80 characters; contains 85 characters
455 | ERROR | [ ] Doc comment short description must end with a full stop
455 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
457 | WARNING | [ ] Line exceeds 80 characters; contains 93 characters
457 | WARNING | [x] 'TODO: Move this and related methods to a helper, it has no business being in this class.' should match the format '@todo Fix problem X here.'
458 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
458 | ERROR | [ ] Missing parameter comment
458 | ERROR | [ ] Missing parameter type
459 | ERROR | [x] Separate the @param and @return sections by a blank line.
459 | ERROR | [ ] Description for the @return value is missing
462 | ERROR | [x] Inline comments must start with a capital letter
462 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
467 | ERROR | [x] Use "elseif" in place of "else if"
484 | WARNING | [x] 'TODO: Are there any timezones not at the hour or halfs?' should match the format '@todo Fix problem X here.'
492 | ERROR | [x] Expected 1 blank line after function; 2 found
495 | ERROR | [x] The closing brace for the class must have an empty line before it
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 84 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/views_ical/src/ViewsIcalHelperInterface.php
--------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
--------------------------------------------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
13 | ERROR | [ ] Parameter $row is not described in comment
20 | ERROR | [ ] Doc comment for parameter $entity does not match actual variable name $field_mapping
41 | ERROR | [ ] Parameter $row is not described in comment
48 | ERROR | [ ] Doc comment for parameter $entity does not match actual variable name $field_mapping
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------

Time: 635ms; Memory: 14MB

Steps to reproduce

Use the below command with arguments.

Fix the phpcs found issues.

📌 Task
Status

Needs work

Version

1.0

Component

Code

Created by

🇫🇷France lazzyvn paris

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • 🇫🇷France lazzyvn paris

    You have free time to update? Could you add me to maintain I can help.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
       /**
    +   * Helper.
    +   *

    That description is not much helpful, since it repeats the property name.

       /**
    -   * Render a row object. This usually passes through to a theme template
    -   * of some form, but not always.
    +   * Render a row object.
    +   *
    +   * This usually passes through a theme template of some form, but not always.
        *
        * @param object $row

    The verb must use the Simple Present tense and the third person singular.

    -    $renderer = $this->getRenderer();
    +    $this->getRenderer();

    If the value returned from $this->getRenderer() is not used, then also the call to $this->getRenderer() can be removed.

    -     /** @var \Drupal\Core\Field\FieldDefinitionInterface[] $field_storage_definitions */
    +    /**
    +     * @var \Drupal\Core\Field\FieldDefinitionInterface[] $field_storage_definitions
    +     */
         // $field_storage_definitions = $style->entityFieldManager->getFieldStorageDefinitions($this->view->field[$options['date_field']]->definition['entity_type']);

    The existing comment is already correct. Type-hinting a variable used in a method is done with a single-line comment.

    -    // Provide an opportunity to
    -
    +    // Provide an opportunity to.
         // Use date_recur's API to generate the events.
         // Recurring events will be automatically handled here.

    Actually, the full sentence is Provide an opportunity to use date_recur's API to generate the events. They are not two different sentences.

    -    else if ($date_field_type === 'daterange') {
    -      // TODO: are date ranges separate date field types?
    -      $this->addDateRangeEvent($events, $row, $timezone, $style_options);
    +      }
    +      else {
    +        if ($date_field_type === 'daterange') {
    +          // @todo are date ranges separate date field types?
    +          $this->addDateRangeEvent($events, $row, $timezone, $style_options);

    Using an else if statement is correct. I do not see any reason to change it to an else statement containing an if.
    What follow @todo is a sentence, which means it starts with a capitalized word and end with a period, a question mark, or an exclamation mark.

    -    if(isset($field_mapping['uid_field'])
    +    if (isset($field_mapping['uid_field'])
           && ($field_mapping['uid_field'] == 'nid'
    -        || $field_mapping['uid_field'] == 'nothing')) {
    +        || $field_mapping['uid_field'] == 'nothing')
    +    ) {

    An if statement should not split on multiple lines like that. The Drupal coding standards give similar code as example of what not to do.

    -        // This is really hacky, It would be really nice to find a way to render as the row.
    +        // This is really hacky, It would be really nice to find a way to
    +        // render as the row.
    

    After hacky there must be a period, or the full sentence becomes an example of comma-splice sentence, which is grammatically wrong, and the word following the comma should be changed to use lower-case characters.

    -            if ($entity->get($field)->getDataDefinition()->getType() == 'created') {
    +            if ($entity->get($field)
    +              ->getDataDefinition()
    +              ->getType() == 'created') {
    

    This is another example of how not to split code. The existing code is already correct.
    The Drupal coding standards do not say that all the lines must be shorter than 81 characters. They say they should be shorter than 81 characters, and lists in which cases lines should be left longer than 80 characters.

    +    // URL field.
         if (isset($field_mapping['url_field']) && $entity->hasField($field_mapping['url_field'])) {
    -      if ($field_mapping['url_field'] == 'body' && !$entity->get('body')->isEmpty()) {
    +      if ($field_mapping['url_field'] == 'body' && !$entity->get('body')
    +        ->isEmpty()) {
    

    The first comment is missing an article, but it is probably better to be left out, since it does not say anything that is not already clear from the code.

    -          // Set recurrence rule
    +          // Set recurrence rule.
               $recurrenceRule = new RecurrenceRule();
    

    Also that comment can be removed.

    -    // Transparency - This isn't a real field, but a default setting applied to all events.
    +    // Transparency - This isn't a real field,
    +    // but a default setting applied to all events.
    

    That line is made shorter than it should be. Less than 81 characters does not mean 40 characters.

    -      //else {
    +      // Else {
           // is DTEND is not a required field, but if it is not included, nor
           // is duration (which we are not using here), then the event's duration
           // is taken to be one day. But do we need to explicitly define that here?
    -      // Do calendar apps handle that? https://tools.ietf.org/html/rfc5545#section-3.6.1
    -      //}
    

    That is commented out code; it is probably useless to change it, but if it is going to be changed, else does not need to be written capitalized, and the indentation does not need to be changed, since it is already correct.

       /**
    -   * Create an event based on a datetime field
    +   * Create an event based on a datetime field.
        *
    -   * @param array $events
    -   * @param \Drupal\Core\Entity\ContentEntityInterface $entity
    -   * @param \DateTimeZone $timezone
    -   * @param array $field_mapping
    +   * {@inheritDoc}
        */
    

    If a comment uses {@inheritDoc}, it does need to contain descriptions, since those are already taken by the parent method. (That is the purpose of {@inheritDoc}.)

        * @return \Drupal\Core\Render\RendererInterface|mixed
    +   *   Get renderer.
    

    Descriptions of return values do not start with a verb, but eventually with an article.

  • First commit to issue fork.
  • 🇮🇳India Ashutosh Ahirwal India

    I have updated the issue summary.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
Production build 0.71.5 2024