PHPCS
./vendor/bin/phpcs --standard="Drupal,DrupalPractice" -n --extensions="php,module,inc,install,test,profile,theme" web/modules/contrib/custom_google_maps_block/
FILE: /home/shivsharma/project/my-drupal10-site/web/modules/contrib/custom_google_maps_block/src/Form/MapsForm.php
------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------
8 | ERROR | Doc comment is empty
------------------------------------------------------------------------------------------------------------------
FILE: /home/shivsharma/project/my-drupal10-site/web/modules/contrib/custom_google_maps_block/src/Plugin/Block/MapsBlock.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 203 ERRORS AFFECTING 173 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] There must be one blank line after the last USE statement; 2 found;
21 | ERROR | [x] Opening brace should be on the same line as the declaration
23 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
26 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
27 | ERROR | [x] Opening brace should be on the same line as the declaration
28 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
29 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
30 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
31 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
32 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
33 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
34 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
35 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
36 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
37 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
38 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
39 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
40 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
41 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
42 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
43 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
44 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
47 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
49 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
52 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
53 | ERROR | [x] Opening brace should be on the same line as the declaration
54 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
56 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
57 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
58 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
59 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
59 | ERROR | [x] Expected newline after closing brace
60 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
61 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
62 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
64 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
64 | ERROR | [x] Short array syntax must be used to define arrays
65 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
66 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
67 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
68 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
69 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
70 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
71 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
72 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
72 | ERROR | [x] Short array syntax must be used to define arrays
73 | ERROR | [x] Short array syntax must be used to define arrays
74 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
77 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
78 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
79 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
80 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
81 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
82 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
83 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
84 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
85 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
86 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
87 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
91 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
93 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
93 | ERROR | [x] Expected 1 blank line after function; 2 found
96 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
98 | ERROR | [x] There must be no blank lines after the function comment
99 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
99 | ERROR | [x] Scope keyword "public" must be followed by a single space; found newline
100 | ERROR | [x] Visibility must be declared on method "blockForm"
100 | ERROR | [x] Expected 1 blank line before function; 0 found
101 | ERROR | [x] Opening brace should be on the same line as the declaration
102 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
103 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
104 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
105 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
106 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
107 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
108 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
108 | ERROR | [x] Use null coalesce operator instead of ternary operator.
110 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
111 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
112 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
113 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
114 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
114 | ERROR | [x] Use null coalesce operator instead of ternary operator.
116 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
117 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
118 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
119 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
119 | ERROR | [x] Use null coalesce operator instead of ternary operator.
122 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
123 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
124 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
125 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
126 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
127 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
127 | ERROR | [x] Use null coalesce operator instead of ternary operator.
129 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
129 | ERROR | [x] Short array syntax must be used to define arrays
130 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
131 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
132 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
133 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
133 | ERROR | [x] Short array syntax must be used to define arrays
134 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
135 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
136 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
138 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
138 | ERROR | [x] Use null coalesce operator instead of ternary operator.
140 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
140 | ERROR | [x] Short array syntax must be used to define arrays
141 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
142 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
143 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
144 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
144 | ERROR | [x] Use null coalesce operator instead of ternary operator.
146 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
146 | ERROR | [x] Short array syntax must be used to define arrays
152 | ERROR | [x] Use null coalesce operator instead of ternary operator.
153 | ERROR | [x] Short array syntax must be used to define arrays
154 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
154 | ERROR | [x] Short array syntax must be used to define arrays
155 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
155 | ERROR | [x] Short array syntax must be used to define arrays
157 | ERROR | [x] Short array syntax must be used to define arrays
158 | ERROR | [x] Short array syntax must be used to define arrays
159 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
159 | ERROR | [x] Short array syntax must be used to define arrays
163 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
167 | ERROR | [x] Use null coalesce operator instead of ternary operator.
170 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
171 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
172 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
173 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
174 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
175 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
175 | ERROR | [x] Use null coalesce operator instead of ternary operator.
177 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
178 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
179 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
180 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
181 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
181 | ERROR | [x] Use null coalesce operator instead of ternary operator.
183 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
184 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
185 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
186 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
187 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
187 | ERROR | [x] Use null coalesce operator instead of ternary operator.
189 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
191 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
191 | ERROR | [x] Short array syntax must be used to define arrays
192 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
193 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
194 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
195 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
195 | ERROR | [x] Short array syntax must be used to define arrays
196 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
197 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
198 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
200 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
200 | ERROR | [x] Use null coalesce operator instead of ternary operator.
202 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
206 | ERROR | [x] Use null coalesce operator instead of ternary operator.
210 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
214 | ERROR | [x] Use null coalesce operator instead of ternary operator.
217 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
218 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
219 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
220 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
221 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
221 | ERROR | [x] Use null coalesce operator instead of ternary operator.
224 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
228 | ERROR | [x] Use null coalesce operator instead of ternary operator.
231 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
233 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
234 | ERROR | [x] Expected 1 blank line after function; 2 found
237 | ERROR | [x] Scope keyword "public" must be followed by a single space; found newline
238 | ERROR | [x] Missing function doc comment
238 | ERROR | [x] Visibility must be declared on method "blockSubmit"
238 | ERROR | [x] Expected 1 blank line before function; 0 found
239 | ERROR | [x] Opening brace should be on the same line as the declaration
240 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
241 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
242 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
243 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
244 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
245 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
246 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
247 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
248 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
249 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
250 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
251 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
252 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
253 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
254 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
255 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
256 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
257 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
258 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
258 | ERROR | [x] No space found before comment text; expected "// dsm($values['enable_marker']);" but found
| | "//dsm($values['enable_marker']);"
258 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
259 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
261 | ERROR | [x] Expected 1 blank line after function; 2 found
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 203 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------
FILE: /home/shivsharma/project/my-drupal10-site/web/modules/contrib/custom_google_maps_block/custom_google_maps_block.module
----------------------------------------------------------------------------------------------------------------------------
FOUND 17 ERRORS AFFECTING 16 LINES
----------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
7 | ERROR | [x] Opening brace should be on the same line as the declaration
8 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
8 | ERROR | [x] Short array syntax must be used to define arrays
9 | 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] Array indentation error, expected 14 spaces but found 16
12 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
13 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
14 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
15 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
16 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
20 | ERROR | [x] Expected 1 blank line after function; 2 found
23 | ERROR | [x] Missing function doc comment
24 | ERROR | [x] Opening brace should be on the same line as the declaration
25 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
26 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 17 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------
Time: 168ms; Memory: 12MB
Steps to reproduce
Exected PHPCS with Drupal Stranded
vendor/bin/phpcs --standard="Drupal,DrupalPractice" -n --extensions="php,module,inc,install,test,profile,theme" web/modules/contrib/custom_google_maps_block/
Proposed resolution
Created a patch.
Comments
Comment #2
avpadernoThe 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.
Comment #3
avpadernoThe usual short description is Hook implementations for the Custom Google Maps block.
The indentation is wrong, since it needs to be increased of two spaces each time.
The short description does not describe the class.
Maps is misspelled, since it is not at the beginning of the sentence.
That class is for a form, not a block.
Since that is a method inherited from a parent class or defined in an interface, the documentation comment does not need to give all that data.
The indentation is wrong.
What I reported in the previous comment still holds true.
Comment #4
shiv_sharma commentedComment #5
shiv_sharma commented@apaderno indentation was fixed by the the PHPCS script.
Comment #6
avpadernoEven in that case, it is still wrong. Each times the indentation is increased, two spaces are added, not four spaces, nor one or more tabs.
Comment #7
shiv_sharma commentedfixed the indentation issue.
added the patch for same. also added screenshot from PHPCS.
Comment #8
avpadernoSince that is a method inherited from a parent class or defined in an interface, the documentation comment does not need to give all that data. That is when
{@inheritdoc}is used.It is sufficient to use method chaining.
Comment #9
shiv_sharma commented@apaderno Patch updated.
Comment #10
avpadernoThe usual short description is Hook implementations for the Custom Google Maps block module.
The config form for the Google maps block. is sufficient, since the class description must not start with Class nor repeat the class name.
The correct description is Provides a Google maps block.
Comment #11
soham sengupta commentedHi, I have updated the patch with the changes.
Comment #12
shiv_sharma commented@apaderno
as per your feedback updated the patch
Comment #13
nisha_j commentedHi, patch #11 failed to apply.
So changing the status to Needs work.
Thankyou.
Comment #16
bharath-kondeti commentedAddressed review and moved changes to a PR. Moving the issue to Needs Review
Comment #19
venkatraman ganesan commentedI ran the command phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig and found no phpcs errors