Fix the issues reported by phpcs

Created on 27 November 2023, 12 months ago
Updated 5 December 2023, 12 months ago

Problem/Motivation

Getting following error/warnings.

FILE: /var/www/html/modules/contrib/critique_and_review/critique_and_review.install
-------------------------------------------------------------------------------
FOUND 17 ERRORS AFFECTING 16 LINES
-------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
3 | ERROR | [x] The second line in the file doc comment must be "@file"
5 | ERROR | [x] Additional blank lines found at end of doc comment
5 | ERROR | [x] There must be no blank lines after the function comment
8 | ERROR | [x] Short array syntax must be used to define arrays
10 | ERROR | [x] Short array syntax must be used to define arrays
11 | ERROR | [x] Short array syntax must be used to define arrays
17 | ERROR | [x] Short array syntax must be used to define arrays
23 | ERROR | [x] Short array syntax must be used to define arrays
30 | ERROR | [x] Short array syntax must be used to define arrays
37 | ERROR | [x] Short array syntax must be used to define arrays
44 | ERROR | [x] Short array syntax must be used to define arrays
51 | ERROR | [x] Short array syntax must be used to define arrays
58 | ERROR | [x] Short array syntax must be used to define arrays
59 | ERROR | [x] Short array syntax must be used to define arrays
60 | ERROR | [x] Short array syntax must be used to define arrays
61 | ERROR | [x] Short array syntax must be used to define arrays

FILE: /var/www/html/modules/contrib/critique_and_review/critique_and_review.module
--------------------------------------------------------------------------------
FOUND 109 ERRORS AND 9 WARNINGS AFFECTING 69 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank
| | line
1 | ERROR | [x] Missing file doc comment
2 | WARNING | [x] Unused use statement
5 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements
| | hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements
| | hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", "*
| | Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or
| | "* Implements hook_foo_BAR_ID_bar() for block templates."
6 | ERROR | [x] There must be no blank lines after the function comment
8 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced
| | with use statements
10 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
10 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
10 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
11 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
13 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 5
14 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 5
15 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 5
16 | WARNING | [x] There must be no blank line following an inline comment
16 | WARNING | [ ] There must be no blank line following an inline comment
16 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 5
16 | ERROR | [x] No space found before comment text; expected "//
| | dump($reviewrsWhoReviewdThisNode);" but found
| | "//dump($reviewrsWhoReviewdThisNode);"
18 | ERROR | [x] Expected 1 space after IF keyword; 0 found
18 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
19 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 7
20 | ERROR | [x] Array indentation error, expected 9 spaces but found 6
21 | ERROR | [x] Array indentation error, expected 9 spaces but found 6
21 | ERROR | [x] Concat operator must be surrounded by a single space
21 | ERROR | [x] Concat operator must be surrounded by a single space
21 | ERROR | [x] Concat operator must be surrounded by a single space
22 | ERROR | [x] Array indentation error, expected 9 spaces but found 6
23 | ERROR | [x] Array closing indentation error, expected 7 spaces but
| | found 4
25 | ERROR | [x] Expected newline after closing brace
25 | ERROR | [x] Expected 1 space after ELSE keyword; newline found
28 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 7
29 | ERROR | [x] Array indentation error, expected 9 spaces but found 6
30 | ERROR | [x] Array indentation error, expected 9 spaces but found 6
30 | ERROR | [x] Concat operator must be surrounded by a single space
31 | ERROR | [x] Array indentation error, expected 9 spaces but found 6
32 | ERROR | [x] Array closing indentation error, expected 7 spaces but
| | found 6
34 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 7
35 | ERROR | [x] Array indentation error, expected 9 spaces but found 6
36 | ERROR | [x] Array indentation error, expected 9 spaces but found 6
37 | ERROR | [x] Array indentation error, expected 9 spaces but found 6
38 | ERROR | [x] Array closing indentation error, expected 7 spaces but
| | found 6
40 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
41 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 9
42 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 9
42 | ERROR | [x] Concat operator must be surrounded by a single space
46 | ERROR | [x] Array closing indentation error, expected 9 spaces but
| | found 10
47 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 9
47 | ERROR | [x] Expected 1 space before "="; 0 found
47 | ERROR | [x] Expected 1 space after "="; 0 found
48 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 9
48 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
48 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
49 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 9
50 | ERROR | [x] Line indented incorrectly; expected 10 spaces, found 9
50 | ERROR | [x] Concat operator must be surrounded by a single space
50 | ERROR | [x] Concat operator must be surrounded by a single space
50 | ERROR | [x] Concat operator must be surrounded by a single space
50 | ERROR | [x] Concat operator must be surrounded by a single space
51 | ERROR | [x] Array indentation error, expected 11 spaces but found 12
52 | ERROR | [x] Array indentation error, expected 11 spaces but found 12
53 | ERROR | [x] Array indentation error, expected 11 spaces but found 12
54 | ERROR | [x] Array indentation error, expected 11 spaces but found 12
54 | ERROR | [x] Expected 1 space after "=>"; 2 found
55 | ERROR | [x] Array indentation error, expected 11 spaces but found 12
55 | ERROR | [x] Short array syntax must be used to define arrays
57 | ERROR | [x] Array closing indentation error, expected 9 spaces but
| | found 10
58 | WARNING | [ ] Line exceeds 80 characters; contains 99 characters
58 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
59 | ERROR | [x] Closing brace indented incorrectly; expected 9 spaces,
| | found 8
62 | ERROR | [x] Closing brace indented incorrectly; expected 3 spaces,
| | found 2
66 | ERROR | [ ] Invalid function name, expected get_reviews but found
| | getReviews
66 | ERROR | [ ] All functions defined in a module file must be prefixed
| | with the module's name, found "getReviews" but expected
| | "critique_and_review_getReviews"
66 | ERROR | [x] Missing function doc comment
67 | WARNING | [ ] Unused variable $ownerId.
67 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
73 | ERROR | [ ] Missing parameter comment
74 | ERROR | [x] Separate the @param and @return sections by a blank line.
74 | ERROR | [ ] Description for the @return value is missing
76 | ERROR | [ ] Invalid function name, expected
| | current_user_is_node_creator but found
| | currentUserIsNodeCreator
76 | ERROR | [ ] All functions defined in a module file must be prefixed
| | with the module's name, found "currentUserIsNodeCreator"
| | but expected
| | "critique_and_review_currentUserIsNodeCreator"
77 | WARNING | [x] There must be no blank line following an inline comment
77 | WARNING | [ ] There must be no blank line following an inline comment
77 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
77 | ERROR | [x] Inline comments must start with a capital letter
77 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
79 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
79 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced
| | with use statements
80 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
80 | ERROR | [x] Inline comments must start with a capital letter
80 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
81 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
82 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
82 | ERROR | [x] Expected 1 space after IF keyword; 0 found
83 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 13
83 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE"
| | but found "true"
84 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
85 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
86 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
86 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE"
| | but found "false"
90 | ERROR | [x] Expected 1 space(s) before asterisk; 3 found
91 | ERROR | [x] Expected 1 space(s) before asterisk; 3 found
91 | ERROR | [x] There must be no blank lines after the function comment
93 | ERROR | [ ] Invalid function name, expected get_reviwers_for_node but
| | found getReviwersForNode
93 | ERROR | [ ] All functions defined in a module file must be prefixed
| | with the module's name, found "getReviwersForNode" but
| | expected "critique_and_review_getReviwersForNode"
94 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
103 | ERROR | [ ] Invalid function name, expected get_user_reviews but found
| | getUserReviews
103 | ERROR | [ ] All functions defined in a module file must be prefixed
| | with the module's name, found "getUserReviews" but
| | expected "critique_and_review_getUserReviews"
103 | ERROR | [x] Missing function doc comment
104 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
114 | ERROR | [ ] Invalid function name, expected getuser_name but found
| | getuserName
114 | ERROR | [ ] All functions defined in a module file must be prefixed
| | with the module's name, found "getuserName" but expected
| | "critique_and_review_getuserName"
114 | ERROR | [x] Missing function doc comment
115 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
115 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced
| | with use statements
115 | ERROR | [x] Comments may not appear after statements
115 | ERROR | [x] Inline comments must start with a capital letter
115 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
116 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 5
117 | ERROR | [x] Expected 1 newline at end of file; 3 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 100 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/critique_and_review/src/Form/CritiqueAndReviewSettingsForm.php
--------------------------------------------------------------------------------
FOUND 98 ERRORS AND 7 WARNINGS AFFECTING 70 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank
| | line
2 | ERROR | [x] Namespaced classes, interfaces and traits should not begin
| | with a file doc comment
4 | ERROR | [x] Doc comment short description must end with a full stop
11 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is Drupal\Core\Form\FormStateInterface.
14 | ERROR | [x] Doc comment short description must end with a full stop
20 | ERROR | [ ] Public method name
| | "CritiqueAndReviewSettingsForm::getFormID" is not in
| | lowerCamel format
20 | ERROR | [x] Expected 1 blank line before function; 0 found
22 | ERROR | [x] Expected 1 blank line after function; 0 found
23 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
24 | ERROR | [x] Expected 4 space(s) before asterisk; 3 found
25 | ERROR | [x] Expected 4 space(s) before asterisk; 3 found
28 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: 'critique_and_review.settings'
30 | ERROR | [x] Expected 1 blank line after function; 0 found
37 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 2 empty lines
39 | ERROR | [x] Short array syntax must be used to define arrays
45 | ERROR | [x] Array closing indentation error, expected 4 spaces but
| | found 7
46 | ERROR | [x] Short array syntax must be used to define arrays
48 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL"
| | but found "null"
51 | ERROR | [x] Expected newline after closing brace
51 | ERROR | [x] Expected 1 space after ELSE keyword; 0 found
54 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 3 empty lines
56 | ERROR | [ ] More than 2 empty lines are not allowed
59 | ERROR | [x] Expected 1 space after "=>"; 2 found
70 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 2 empty lines
75 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
76 | ERROR | [x] Expected 1 space after IF keyword; 0 found
81 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
83 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
84 | ERROR | [x] No space found before comment text; expected "//
| | kint($title);" but found "//kint($title);"
86 | ERROR | [x] Concat operator must be surrounded by a single space
87 | ERROR | [x] Array indentation error, expected 8 spaces but found 12
88 | ERROR | [x] Array indentation error, expected 8 spaces but found 12
88 | ERROR | [x] Concat operator must be surrounded by a single space
89 | ERROR | [x] Array indentation error, expected 8 spaces but found 12
90 | ERROR | [x] Array indentation error, expected 8 spaces but found 12
92 | ERROR | [x] Array closing indentation error, expected 6 spaces but
| | found 10
94 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 10
94 | ERROR | [x] Concat operator must be surrounded by a single space
94 | ERROR | [x] Concat operator must be surrounded by a single space
96 | ERROR | [x] Expected 1 space after "=>"; 2 found
99 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 10
99 | ERROR | [x] Concat operator must be surrounded by a single space
99 | ERROR | [x] Concat operator must be surrounded by a single space
101 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 10
101 | ERROR | [x] Concat operator must be surrounded by a single space
101 | ERROR | [x] Concat operator must be surrounded by a single space
103 | ERROR | [x] Expected 1 space after "=>"; 2 found
107 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 10
107 | ERROR | [x] Concat operator must be surrounded by a single space
107 | ERROR | [x] Concat operator must be surrounded by a single space
107 | ERROR | [x] Short array syntax must be used to define arrays
112 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 10
113 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
113 | ERROR | [x] Closing brace indented incorrectly; expected 4 spaces,
| | found 6
115 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
115 | ERROR | [x] Inline comments must start with a capital letter
115 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
116 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
116 | ERROR | [x] Concat operator must be surrounded by a single space
121 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: "Set title to add new review item. To add even more
| | items save this form and repeat the process "
121 | WARNING | [ ] #description values usually have to run through t() for
| | translation
124 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
124 | ERROR | [x] Concat operator must be surrounded by a single space
124 | ERROR | [x] Concat operator must be surrounded by a single space
126 | ERROR | [x] Expected 1 space after "=>"; 2 found
128 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: "Title is mandatory, leave this field empty only if
| | you do not want to add a new item."
128 | WARNING | [ ] #description values usually have to run through t() for
| | translation
130 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
130 | ERROR | [x] Concat operator must be surrounded by a single space
130 | ERROR | [x] Concat operator must be surrounded by a single space
132 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
132 | ERROR | [x] Concat operator must be surrounded by a single space
132 | ERROR | [x] Concat operator must be surrounded by a single space
134 | ERROR | [x] Expected 1 space after "=>"; 2 found
137 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: "Save to add another item."
137 | WARNING | [ ] #description values usually have to run through t() for
| | translation
139 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 2 empty lines
141 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
143 | ERROR | [x] Expected 1 space after "=>"; 2 found
146 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 2 empty lines
148 | ERROR | [x] Expected one space after the comma, 0 found
156 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
160 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
161 | ERROR | [x] Short array syntax must be used to define arrays
162 | ERROR | [x] Short array syntax must be used to define arrays
167 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
168 | ERROR | [x] Expected 1 space after IF keyword; 0 found
168 | ERROR | [x] Concat operator must be surrounded by a single space
168 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
169 | ERROR | [x] Equals sign not aligned with surrounding assignments;
| | expected 8 spaces but found 1 space
169 | ERROR | [x] Concat operator must be surrounded by a single space
170 | ERROR | [x] Equals sign not aligned with surrounding assignments;
| | expected 1 space but found 3 spaces
170 | ERROR | [x] Expected 1 space after "="; 2 found
170 | ERROR | [x] Concat operator must be surrounded by a single space
174 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
175 | ERROR | [x] Expected 1 space after IF keyword; 0 found
175 | ERROR | [x] Concat operator must be surrounded by a single space
175 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
176 | ERROR | [x] Equals sign not aligned with surrounding assignments;
| | expected 8 spaces but found 1 space
177 | ERROR | [x] Equals sign not aligned with surrounding assignments;
| | expected 1 space but found 3 spaces
177 | ERROR | [x] Expected 1 space after "="; 2 found
177 | ERROR | [x] Concat operator must be surrounded by a single space
183 | ERROR | [x] Expected 1 space after IF keyword; 0 found
183 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
193 | ERROR | [x] Expected 1 newline at end of file; 2 found

FILE: /var/www/html/modules/contrib/critique_and_review/src/Form/TemplateCritiqueAndReviewForm.php
--------------------------------------------------------------------------------
FOUND 134 ERRORS AND 15 WARNINGS AFFECTING 97 LINES
--------------------------------------------------------------------------------
6 | WARNING | [x] Unused use statement
14 | ERROR | [x] Additional blank lines found at end of doc comment
14 | ERROR | [x] There must be exactly one newline after the class comment
17 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
17 | ERROR | [ ] Missing member variable doc comment
18 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
18 | ERROR | [ ] Missing member variable doc comment
19 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
19 | ERROR | [ ] Missing member variable doc comment
20 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
20 | ERROR | [ ] Missing member variable doc comment
26 | ERROR | [x] Expected 1 blank line before function; 2 found
28 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 3
28 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
29 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 3
29 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
30 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
30 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
33 | ERROR | [x] Expected newline after closing brace
34 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL"
| | but found "null"
35 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL"
| | but found "null"
37 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 2 empty lines
40 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 3 empty lines
42 | ERROR | [ ] More than 2 empty lines are not allowed
51 | WARNING | [ ] Line exceeds 80 characters; contains 90 characters
55 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
59 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
60 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
60 | ERROR | [x] Expected 1 space after closing parenthesis; found 2
65 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
65 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
66 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
66 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
67 | ERROR | [x] No space found before comment text; expected "//
| | kint($review->review_title);" but found
| | "//kint($review->review_title);"
67 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
69 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 10
70 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 10
74 | WARNING | [x] There must be no blank line following an inline comment
74 | WARNING | [ ] There must be no blank line following an inline comment
74 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 3
76 | WARNING | [x] There must be no blank line following an inline comment
76 | WARNING | [ ] There must be no blank line following an inline comment
76 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
85 | ERROR | [x] Expected 1 space after "=>"; 2 found
87 | WARNING | [ ] #description values usually have to run through t() for
| | translation
91 | ERROR | [x] Array indentation error, expected 6 spaces but found 12
92 | ERROR | [x] Array indentation error, expected 6 spaces but found 12
92 | ERROR | [x] Expected 1 space after "=>"; 2 found
93 | ERROR | [x] Array indentation error, expected 6 spaces but found 12
99 | ERROR | [x] Expected 1 space after "=>"; 2 found
100 | ERROR | [x] Short array syntax must be used to define arrays
100 | ERROR | [x] Short array syntax must be used to define arrays
102 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 2 empty lines
104 | WARNING | [x] There must be no blank line following an inline comment
104 | WARNING | [ ] There must be no blank line following an inline comment
106 | ERROR | [x] Expected 1 space after IF keyword; 0 found
111 | ERROR | [x] Short array syntax must be used to define arrays
111 | ERROR | [x] Short array syntax must be used to define arrays
118 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
122 | ERROR | [x] Visibility must be declared on method "print_form_item"
122 | ERROR | [ ] Method name
| | "TemplateCritiqueAndReviewForm::print_form_item" is not in
| | lowerCamel format
122 | ERROR | [x] Missing function doc comment
124 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
124 | ERROR | [x] Concat operator must be surrounded by a single space
125 | ERROR | [x] Array indentation error, expected 8 spaces but found 12
126 | ERROR | [x] Array indentation error, expected 8 spaces but found 12
129 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
129 | ERROR | [x] Concat operator must be surrounded by a single space
131 | ERROR | [x] Expected 1 space after "=>"; 2 found
135 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
135 | ERROR | [x] Inline comments must start with a capital letter
135 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
136 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
136 | ERROR | [x] Expected 1 space after IF keyword; 0 found
136 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
137 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
137 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
138 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
139 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
139 | ERROR | [x] Expected newline after closing brace
139 | ERROR | [x] Expected 1 space after ELSE keyword; 0 found
139 | ERROR | [x] There should be no white space after an opening "{"
139 | ERROR | [x] Comments may not appear after statements
139 | ERROR | [x] Inline comments must start with a capital letter
139 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
140 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
141 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
143 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
143 | ERROR | [x] Expected 1 space after IF keyword; 0 found
144 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
145 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
145 | ERROR | [x] Expected newline after closing brace
145 | ERROR | [x] Expected 1 space after ELSE keyword; 0 found
146 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
147 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
149 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
149 | ERROR | [x] Concat operator must be surrounded by a single space
149 | ERROR | [x] Concat operator must be surrounded by a single space
150 | ERROR | [x] Array indentation error, expected 8 spaces but found 14
151 | ERROR | [x] Array indentation error, expected 8 spaces but found 14
152 | ERROR | [x] Array indentation error, expected 8 spaces but found 14
153 | ERROR | [x] Array indentation error, expected 8 spaces but found 14
156 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
169 | ERROR | [x] Expected 1 space before opening brace; found 2
171 | ERROR | [x] Expected 1 space after "="; 2 found
175 | ERROR | [x] Expected 1 space after closing parenthesis; found 2
179 | ERROR | [x] Concat operator must be surrounded by a single space
185 | ERROR | [x] Inline comments must start with a capital letter
185 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
186 | ERROR | [x] Expected 1 space after IF keyword; 0 found
189 | ERROR | [x] Expected 1 blank line after function; 0 found
190 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
195 | ERROR | [x] Inline comments must start with a capital letter
195 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
200 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
200 | WARNING | [ ] Unused variable $review.
203 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 2 empty lines
205 | ERROR | [x] Expected 1 space after IF keyword; 0 found
206 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 10
206 | ERROR | [x] Inline comments must start with a capital letter
206 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
207 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 10
208 | ERROR | [x] Object operator not indented correctly; expected 12 spaces
| | but found 11
210 | ERROR | [x] Array indentation error, expected 13 spaces but found 12
217 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
217 | ERROR | [x] Closing brace indented incorrectly; expected 4 spaces,
| | found 8
220 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 7
220 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
221 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 10
221 | ERROR | [x] Short array syntax must be used to define arrays
227 | ERROR | [x] Array closing indentation error, expected 10 spaces but
| | found 13
228 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 13
232 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
232 | ERROR | [x] Closing brace indented incorrectly; expected 4 spaces,
| | found 8
238 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL"
| | but found "null"
241 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
241 | ERROR | [x] Object operator not indented correctly; expected 6 spaces
| | but found 4
242 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
243 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
244 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
246 | ERROR | [x] Expected 1 space after IF keyword; 0 found
256 | ERROR | [ ] Doc comment short description must end with a full stop
256 | ERROR | [ ] Doc comment short description must be on a single line,
| | further text should be a separate paragraph
260 | ERROR | [x] Expected 1 space after closing parenthesis; found 2
261 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL"
| | but found "null"
264 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
265 | ERROR | [x] Expected 1 space after IF keyword; 0 found
265 | ERROR | [x] There should be no white space before a closing ")"
269 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL"
| | but found "null"

FILE: /var/www/html/modules/contrib/critique_and_review/src/Plugin/Block/CritiqueAndReviewBlock.php
--------------------------------------------------------------------------------
FOUND 23 ERRORS AND 10 WARNINGS AFFECTING 27 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
2 | ERROR | [x] Namespaced classes, interfaces and traits should not begin
| | with a file doc comment
10 | WARNING | [x] Unused use statement
11 | WARNING | [x] Unused use statement
11 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is Drupal\Core\Cache\Cache.
12 | WARNING | [x] Unused use statement
13 | WARNING | [x] Unused use statement
14 | WARNING | [x] Unused use statement
33 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
34 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
36 | ERROR | [x] Expected 1 space after IF keyword; 0 found
37 | ERROR | [x] Short array syntax must be used to define arrays
38 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
40 | ERROR | [x] Short array syntax must be used to define arrays
40 | ERROR | [x] Short array syntax must be used to define arrays
40 | ERROR | [ ] The array declaration extends to column 122 (the limit is
| | 120). The array content should be split up over multiple
| | lines
44 | ERROR | [ ] The array declaration extends to column 121 (the limit is
| | 120). The array content should be split up over multiple
| | lines
45 | ERROR | [x] Expected 1 space after "=>"; 3 found
48 | ERROR | [x] Array indentation error, expected 10 spaces but found 9
49 | WARNING | [x] A comma should follow the last multiline array item. Found:
| | ]
53 | ERROR | [x] Array indentation error, expected 8 spaces but found 10
54 | ERROR | [x] Array indentation error, expected 8 spaces but found 10
55 | ERROR | [x] Array indentation error, expected 8 spaces but found 10
57 | ERROR | [x] Expected newline after closing brace
58 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 7
61 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
62 | ERROR | [x] Expected 1 space after "=>"; 3 found
66 | WARNING | [x] A comma should follow the last multiline array item. Found:
| | ]
66 | ERROR | [x] Array closing indentation error, expected 8 spaces but
| | found 6
70 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
70 | ERROR | [x] Closing brace indented incorrectly; expected 2 spaces,
| | found 3
70 | ERROR | [x] Expected 1 blank line after function; 0 found
71 | ERROR | [x] The closing brace for the class must have an empty line
| | before it

Steps to reproduce

Run following command

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/critique_and_review/

Proposed resolution

Above error/warnings need to be fixed.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India manpreet_singh

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @manpreet_singh
  • Assigned to dark-o
  • 🇭🇷Croatia dark-o
  • 🇲🇼Malawi chancenyasulu

    After running auto fix
    ./vendor/bin/phpcbf --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,ym web/modules/contrib/critique_and_review/

    PHPCBF RESULT SUMMARY
    ----------------------------------------------------------------------------------------------------------------------------------
    FILE FIXED REMAINING
    ----------------------------------------------------------------------------------------------------------------------------------
    /opt/lampp/htdocs/develop/web/modules/contrib/critique_and_review/src/Form/TemplateCritiqueAndReviewForm.php 130 11
    /opt/lampp/htdocs/develop/web/modules/contrib/critique_and_review/src/Form/CritiqueAndReviewSettingsForm.php 100 1
    /opt/lampp/htdocs/develop/web/modules/contrib/critique_and_review/src/Plugin/Block/CritiqueAndReviewBlock.php 28 1
    /opt/lampp/htdocs/develop/web/modules/contrib/critique_and_review/RADME.md 1 4
    /opt/lampp/htdocs/develop/web/modules/contrib/critique_and_review/critique_and_review.module 101 21
    /opt/lampp/htdocs/develop/web/modules/contrib/critique_and_review/critique_and_review.install 17 1
    ----------------------------------------------------------------------------------------------------------------------------------
    A TOTAL OF 377 ERRORS WERE FIXED IN 6 FILES
    ----------------------------------------------------------------------------------------------------------------------------------

    Time: 291ms; Memory: 12MB

    Remaining errors

    FILE: /opt/lampp/htdocs/develop/web/modules/contrib/critique_and_review/src/Form/TemplateCritiqueAndReviewForm.php
    ---------------------------------------------------------------------------------------------------------------------
    FOUND 8 ERRORS AND 3 WARNINGS AFFECTING 10 LINES
    ---------------------------------------------------------------------------------------------------------------------
    14 | ERROR | Missing member variable doc comment
    15 | ERROR | Missing member variable doc comment
    16 | ERROR | Missing member variable doc comment
    17 | ERROR | Missing member variable doc comment
    45 | WARNING | Line exceeds 80 characters; contains 90 characters
    49 | WARNING | Line exceeds 80 characters; contains 84 characters
    59 | WARNING | Line exceeds 80 characters; contains 85 characters
    112 | ERROR | Doc comment is empty
    115 | ERROR | Public method name "TemplateCritiqueAndReviewForm::print_form_item" is not in lowerCamel format
    252 | ERROR | Doc comment short description must end with a full stop
    252 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
    ---------------------------------------------------------------------------------------------------------------------

    FILE: /opt/lampp/htdocs/develop/web/modules/contrib/critique_and_review/src/Form/CritiqueAndReviewSettingsForm.php
    ------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------
    17 | ERROR | Public method name "CritiqueAndReviewSettingsForm::getFormID" is not in lowerCamel format
    ------------------------------------------------------------------------------------------------------------------

    FILE: /opt/lampp/htdocs/develop/web/modules/contrib/critique_and_review/src/Plugin/Block/CritiqueAndReviewBlock.php
    ---------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------------------
    35 | ERROR | The array declaration extends to column 121 (the limit is 120). The array content should be split up over multiple lines
    ---------------------------------------------------------------------------------------------------------------------------------------

    FILE: /opt/lampp/htdocs/develop/web/modules/contrib/critique_and_review/RADME.md
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    --------------------------------------------------------------------------------
    5 | WARNING | Line exceeds 80 characters; contains 99 characters
    15 | WARNING | Line exceeds 80 characters; contains 81 characters
    30 | WARNING | Line exceeds 80 characters; contains 84 characters
    31 | WARNING | Line exceeds 80 characters; contains 86 characters
    --------------------------------------------------------------------------------

    FILE: /opt/lampp/htdocs/develop/web/modules/contrib/critique_and_review/critique_and_review.module
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 16 ERRORS AND 5 WARNINGS AFFECTING 15 LINES
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    3 | ERROR | Missing short description in doc comment
    14 | WARNING | Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", "* Implements
    | | hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
    18 | WARNING | Line exceeds 80 characters; contains 88 characters
    65 | WARNING | Line exceeds 80 characters; contains 100 characters
    73 | ERROR | Doc comment is empty
    76 | ERROR | Invalid function name, expected get_reviews but found getReviews
    76 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "getReviews" but expected "critique_and_review_getReviews"
    83 | ERROR | Missing parameter comment
    85 | ERROR | Description for the @return value is missing
    87 | ERROR | Invalid function name, expected current_user_is_node_creator but found currentUserIsNodeCreator
    87 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "currentUserIsNodeCreator" but expected "critique_and_review_currentUserIsNodeCreator"
    102 | ERROR | Invalid function name, expected get_reviwers_for_node but found getReviwersForNode
    102 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "getReviwersForNode" but expected "critique_and_review_getReviwersForNode"
    112 | ERROR | Doc comment is empty
    115 | ERROR | Invalid function name, expected get_user_reviews but found getUserReviews
    115 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "getUserReviews" but expected "critique_and_review_getUserReviews"
    126 | ERROR | Doc comment is empty
    129 | ERROR | Invalid function name, expected getuser_name but found getuserName
    129 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "getuserName" but expected "critique_and_review_getuserName"
    146 | WARNING | Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
    146 | WARNING | Avoid backslash escaping in translatable strings when possible, use "" quotes instead
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    FILE: /opt/lampp/htdocs/develop/web/modules/contrib/critique_and_review/critique_and_review.install
    ---------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------
    8 | ERROR | Doc comment is empty
    ---------------------------------------------------------------------------------------------------

    Time: 90ms; Memory: 10MB

    Command used: ./vendor/bin/phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,ym web/modules/contrib/critique_and_review/

    • 0f5e586d committed on 1.0.x
      Issue #3404276: Fix the issues reported by phpcs
      
  • 🇭🇷Croatia dark-o

    fixed most of warning in the dev branch

  • 🇭🇷Croatia dark-o

    fixed in dev branch

  • 🇭🇷Croatia dark-o

    @chancenyasulu Sorry I did not see your comment, I also committed changes,

  • Status changed to Fixed 12 months ago
  • 🇭🇷Croatia dark-o

    I committed fixes into the dev branch

  • 🇭🇷Croatia dark-o

    I am trying to create beta 2 release but no luck, I am on branch 1.0.x
    I created tag
    git tag 1.0.x-b2
    pushed it
    git push origin 1.0.x-b2
    but I can not see this tag to create realse from
    https://www.drupal.org/node/add/project-release/3404149 →
    can anybody help please

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024