Drupal coding standards issues

Created on 12 May 2023, over 1 year ago

Problem/Motivation

Module's code contains several Drupal Coding Standards issues. This task is created to fix them.

Steps to reproduce

Run the command:

phpcs --standard=Drupal
/web/modules/contrib/smart_content_cdn/

Proposed resolution

Fix the following coding standards issues and upload the patch or create an MR with fixes.

FILE: \modules\contrib\smart_content_cdn\tests\src\Unit\EvaluationTest.php
---------------------------------------------------------------------------------------
FOUND 247 ERRORS AND 20 WARNINGS AFFECTING 264 LINES
---------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
17 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
19 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
20 | ERROR | [ ] Missing @var tag in member variable comment
21 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
23 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
25 | ERROR | [ ] Missing @var tag in member variable comment
26 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
28 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
31 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
32 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
34 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
35 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
36 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
37 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
38 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
39 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
40 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
41 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
42 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
43 | WARNING | [x] A comma should follow the last multiline array item. Found: TRUE
50 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
51 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
52 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
53 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
54 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
55 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
56 | WARNING | [x] A comma should follow the last multiline array item. Found: TRUE
63 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
64 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
65 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
66 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
67 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
75 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
76 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
77 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
78 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
79 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
80 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
81 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
82 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
83 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
84 | WARNING | [x] A comma should follow the last multiline array item. Found: TRUE
91 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
92 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
93 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
94 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
95 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
96 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
97 | WARNING | [x] A comma should follow the last multiline array item. Found: TRUE
104 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
105 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
106 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
107 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
108 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
109 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
110 | WARNING | [x] A comma should follow the last multiline array item. Found: TRUE
118 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
120 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
121 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
125 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
126 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
127 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
128 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
129 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
130 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
131 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
132 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
133 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
137 | ERROR | [x] Array indentation error, expected 42 spaces but found 44
138 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
145 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
146 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
147 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
148 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
149 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
150 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
154 | ERROR | [x] Array indentation error, expected 42 spaces but found 44
155 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
162 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
163 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
164 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
165 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
166 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
167 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
171 | ERROR | [x] Array indentation error, expected 42 spaces but found 44
172 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
182 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
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 14 spaces but found 16
186 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
187 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
188 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
189 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
190 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
194 | ERROR | [x] Array indentation error, expected 42 spaces but found 44
195 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
202 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
203 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
204 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
205 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
206 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
207 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
211 | ERROR | [x] Array indentation error, expected 42 spaces but found 44
212 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
219 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
220 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
221 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
222 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
223 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
224 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
228 | ERROR | [x] Array indentation error, expected 42 spaces but found 44
229 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
239 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
240 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
241 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
242 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
243 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
244 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
245 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
246 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
247 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
251 | ERROR | [x] Array indentation error, expected 42 spaces but found 44
252 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
259 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
260 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
261 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
262 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
263 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
264 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
268 | ERROR | [x] Array indentation error, expected 42 spaces but found 44
269 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
276 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
277 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
278 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
279 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
280 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
281 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
285 | ERROR | [x] Array indentation error, expected 42 spaces but found 44
286 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
296 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
297 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
298 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
299 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
300 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
301 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
302 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
303 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
304 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
308 | ERROR | [x] Array indentation error, expected 42 spaces but found 44
309 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
316 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
317 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
318 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
319 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
320 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
321 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
322 | ERROR | [x] Array indentation error, expected 38 spaces but found 40
323 | ERROR | [x] Array indentation error, expected 38 spaces but found 40
324 | ERROR | [x] Array indentation error, expected 38 spaces but found 40
325 | WARNING | [x] A comma should follow the last multiline array item. Found: TRUE
333 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
334 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
335 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
336 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
337 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
338 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
339 | ERROR | [x] Array indentation error, expected 38 spaces but found 40
340 | ERROR | [x] Array indentation error, expected 38 spaces but found 40
350 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
351 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
352 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
353 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
354 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
355 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
356 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
357 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
358 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
361 | ERROR | [x] Array indentation error, expected 42 spaces but found 44
362 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
369 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
370 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
371 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
372 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
373 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
374 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
377 | ERROR | [x] Array indentation error, expected 42 spaces but found 44
378 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
385 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
386 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
387 | ERROR | [x] Array indentation error, expected 22 spaces but found 24
388 | ERROR | [x] Array indentation error, expected 26 spaces but found 28
389 | ERROR | [x] Array indentation error, expected 30 spaces but found 32
390 | ERROR | [x] Array indentation error, expected 34 spaces but found 36
393 | ERROR | [x] Array indentation error, expected 42 spaces but found 44
394 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
404 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
405 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
406 | ERROR | [x] Object operator not indented correctly; expected 10 spaces but found 12
409 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
410 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
411 | ERROR | [x] Object operator not indented correctly; expected 10 spaces but found 13
413 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
414 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
415 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
416 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
417 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
418 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
419 | ERROR | [x] Object operator not indented correctly; expected 18 spaces but found 20
420 | ERROR | [ ] The array declaration extends to column 81 (the limit is 80). The array content should be split up over multiple lines
422 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
423 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
424 | ERROR | [x] Object operator not indented correctly; expected 18 spaces but found 20
425 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
426 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
427 | ERROR | [x] Object operator not indented correctly; expected 18 spaces but found 20
429 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
430 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
431 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
432 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
434 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
435 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
436 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
438 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
441 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
442 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
443 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
444 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
446 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
449 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
450 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
451 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
453 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
456 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
457 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
458 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
460 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
463 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
464 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
465 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
467 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
470 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
471 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
472 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
474 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
474 | ERROR | [x] Missing function doc comment
474 | ERROR | [ ] Protected method name "EvaluationTest::_evaluateDecisions" is not in lowerCamel format
475 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
476 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
478 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
479 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
480 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
481 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
482 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
483 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
484 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
486 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
487 | ERROR | [x] Expected 5 space(s) before asterisk; 6 found
488 | ERROR | [x] Expected 5 space(s) before asterisk; 6 found
489 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
490 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
492 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
493 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
494 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
494 | ERROR | [x] Expected 1 blank line after function; 0 found
495 | ERROR | [x] The closing brace for the class must have an empty line before it
------------------------------------------------------------------------------------------------------------

FILE: \modules\contrib\smart_content_cdn\tests\src\Unit\VaryTest.php
------------------------------------------------------------------------------------------------------------
FOUND 114 ERRORS AFFECTING 110 LINES
------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
21 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
23 | ERROR | [ ] Missing @var tag in member variable comment
24 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
24 | ERROR | [ ] Class property $header_event_subscriber should use lowerCamel naming without underscores
26 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
28 | ERROR | [ ] Missing @var tag in member variable comment
29 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
31 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
34 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
35 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
37 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
38 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
39 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
41 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
43 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
44 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
46 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
47 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
48 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
51 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
52 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
53 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
56 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
57 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
58 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
59 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
62 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
63 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
65 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
66 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
67 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
68 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
69 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
71 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
72 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
73 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
75 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
76 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
77 | ERROR | [x] Object operator not indented correctly; expected 14 spaces but found 16
81 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
82 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
83 | ERROR | [x] Object operator not indented correctly; expected 14 spaces but found 16
84 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
86 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
87 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
88 | ERROR | [x] Object operator not indented correctly; expected 10 spaces but found 12
90 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
91 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
93 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
94 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
95 | ERROR | [x] Object operator not indented correctly; expected 10 spaces but found 12
99 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
100 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
101 | ERROR | [x] Object operator not indented correctly; expected 10 spaces but found 12
103 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
104 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
106 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
107 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
108 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
110 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
113 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
114 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
116 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
117 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
119 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
120 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
121 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
123 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
126 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
127 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
129 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
130 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
132 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
133 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
134 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
135 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
137 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
140 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
141 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
143 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
144 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
146 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
147 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
148 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
149 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
151 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
154 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
155 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
157 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
158 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
160 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
161 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
162 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
163 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
165 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
165 | ERROR | [x] Missing function doc comment
165 | ERROR | [ ] Protected method name "VaryTest::_getAlteredHeaders" is not in lowerCamel format
166 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
167 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
169 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
170 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
171 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
172 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
174 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
175 | ERROR | [x] Expected 5 space(s) before asterisk; 6 found
176 | ERROR | [x] Expected 5 space(s) before asterisk; 6 found
177 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
178 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
180 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
181 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
182 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
182 | ERROR | [x] Expected 1 blank line after function; 0 found
183 | ERROR | [x] The closing brace for the class must have an empty line before it
------------------------------------------------------------------------------------------------------------

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇮🇳India Shanu Chouhan

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

Merge Requests

Comments & Activities

  • Issue created by @Shanu Chouhan
  • Issue was unassigned.
  • 🇮🇳India Shanu Chouhan

    Fixed Some PHPCS issues.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    -    return condition.settings.smart_cdn.value ?? null;
    +    return condition.settings.smart_cdn.value ? ? NULL;

    condition.settings.smart_cdn.value ?? null is not a valid JavaScript expression (since JavaScript does not have a null coalescing operator); adding a space does not make it valid.
    No warnings/errors have been shown in the report for that file.

         // Output current header data.
         $form['header_output'] = [
           '#markup' => '<h2>Current Headers</h1>
    -                              <div>Audience: ' . $audience_header . '</div>
    -                              <div>Interest: ' . $interest_header . '</div>',
    +                                    <div>Audience: ' . $audience_header . '</div>
    +                                    <div>Interest: ' . $interest_header . '</div>',
         ];

    The indentation of those lines is still wrong, since the indentation must be increased of two spaces each time.

    +   * Multi-dimensional array of decisions to be evaluated,keyed by condition.
    +   *
    +   * @var array
    +   */
    +  protected $decisions;

    After a comma, there must be a space.

    +  /**
    +   * Decision evaluator object.
    +   *
    +   * @var object
    +   */
    +  protected $evaluator;

    The description is missing a definite article.

    +  /**
    +   * Implements setUp().
    +   */
    +  protected function setUp(): void {

    Method descriptions must not start with Implements nor repeat the method name.

    +  /**
    +   * {@inheritdoc}
    +   */
    +  protected function _evaluateDecisions($key): void {

    {@inheritdoc} must be used for inherited methods or methods defined in an interface.

    +  /**
    +   * Array of ResponseEvent objects keyed by test type.
    +   *
    +   * @var object
    +   */
    +  protected $events;

    Since that property is described as an array, its type cannot be object.

    The patch is changing files without any reported warning/error. Either the report is updated, or the patch only changes the files shown in the report.

  • Assigned to nitin_lama
  • @nitin_lama opened merge request.
  • Issue was unassigned.
  • 🇮🇳India nitin_lama India

    DI issues still needs to be addressed.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    +  /**
    +   * Sets the test up.
    +   */
    +  protected function setUp(): void {
    +    parent::setUp();
    +    $this->attachSettings();
    +  }

    Since that is an inherited method, the documentation comment must be different.

    +  /**
    +   * {@inheritdoc}
    +   */
    +  protected function evaluateDecisions($key): void {

    That is not an inherited method. Its documentation comment must be different.

    -        // Loop through decisions by $key.
    -        foreach ($this->decisions[$key] as $decision) {
    -            // Get segment id from decision evaluation.
    -            $segment_id = $this->evaluator->evaluate($decision);
    -            $this->assertEquals('segmentC', $segment_id);
    -        }
    +    // Loop through decisions by $key.
    +    foreach ($this->decisions[$key] as $decision) {
    +      // Get segment id from decision evaluation.
    +      $segment_id = $this->evaluator->evaluate($decision);
    +      $this->assertEquals('segmentC', $segment_id);
         }

    That comment is not necessary, since it describes something already clear from the code.

    +  /**
    +   * Sets the test up.
    +   */
    +  protected function setUp(): void {

    The documentation comment for inherited methods is different.

    +  /**
    +   * Test that vary header is empty when there are no cache tags.
    +   */
    +  public function testVaryHeadersNoTags(): void {

    The verb in the description must use the third person singular (I test, you test, he/she/it …).

    +  /**
    +   * {@inheritdoc}
    +   */
    +  protected function getAlteredHeaders($key) {

    That is not an inherited method; its documentation comment must be different.

    +  /**
    +   * Implements tearDown().
    +   */
    +  protected function tearDown(): void {

    The description for a method must not start with Implements nor repeat the method name. That is an inherited method and its documentation comment must be different.

  • First commit to issue fork.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India sakthi_dev

    Updated MR based on #9. Please review.

  • Status changed to Needs work over 1 year ago
  • 🇵🇭Philippines roberttabigue

    Hi,

    I'm still seeing PHPCS errors after applying the latest Merge to the Smart Content CDN module with version 1.0.x-dev and with Drupal core version 9.5.8.

    Moving this to Needs work for now.
    Kindly refer to the attached screenshots, please.

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India sakthi_dev

    Please review.

  • 🇨🇦Canada RobLoach Earth

    Looks like this is taking action on JS too, which is likely unintentional...

    diff --git a/js/condition.cdn.js b/js/condition.cdn.js
    index 1fca7b4..92ee348 100644
    --- a/js/condition.cdn.js
    +++ b/js/condition.cdn.js
    @@ -11,7 +11,7 @@
     
       // Handle Smart CDN conditions based on settings.
       Drupal.smartContent.plugin.Field['smart_cdn'] = function (condition) {
    -    return condition.settings.smart_cdn.value ?? null;
    +    return condition.settings.smart_cdn.value ? ? NULL;
       }
     
     })(Drupal);
    diff --git a/js/condition_type.cdn.js b/js/condition_type.cdn.js
    index 39d22bb..64ea32a 100644
    --- a/js/condition_type.cdn.js
    +++ b/js/condition_type.cdn.js
    @@ -15,12 +15,12 @@
           for(var i = 0; i < value.length; i++) {
             // Check array value with value set in Segment condition.
             if (value[i] === condition.settings['value']) {
    -          return true;
    +          return TRUE;
             }
           }
         }
     
    -    return false;
    +    return FALSE;
       };
     
    -})(Drupal);
    \ No newline at end of file
    +})(Drupal);
    
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    apaderno → changed the visibility of the branch 3359899-fix-the-issues to hidden.

  • Pipeline finished with Failed
    5 months ago
    Total: 36s
    #195373
  • 🇺🇸United States kelly.m.jacobs

    kelly.m.jacobs → made their first commit to this issue’s fork.

  • Status changed to Needs work 3 months ago
  • 🇵🇭Philippines roberttabigue

    Hi @kellyjacobs,

    After reviewing and applying the MR!4 to the Smart Content CDN module with 1.0.x-dev on Drupal 10, not all of the PHPCS errors were resolved.
    Please see below:

    FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/smart_content_cdn/js/interest_count.js
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------
     59 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
    -----------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/smart_content_cdn/tests/src/Unit/VaryTest.php
    ------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\DependencyInjection\ContainerBuilder.
    ------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/smart_content_cdn/tests/src/Unit/EvaluationTest.php
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\smart_content_block\Plugin\smart_content\Decision\MultipleBlockDecision.
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/smart_content_cdn/src/Form/SmartContentCDNConfigForm.php
    -----------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Ajax\AjaxResponse.
    -----------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/smart_content_cdn/src/EventSubscriber/SmartCDNCookie.php
    -----------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------------------------
     8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Symfony\Component\HttpFoundation\Cookie.
    -----------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/roberttabigue/Project/DrupalOrg/drupalorgissues/web/modules/contrib/smart_content_cdn/src/EventSubscriber/HeaderEventSubscriber.php
    ------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Symfony\Component\HttpKernel\Event\ResponseEvent.
    ------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------------------------

    I ran this command on the module:
    phpcs --standard=Drupal smart_content_cdn/

    I'm moving this to ‘Needs work’ for now.

    Thank you!

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    avpaderno → changed the visibility of the branch 3359899-gitlab-ci-reports to hidden.

  • Assigned to akulsaxena
  • 🇮🇳India akulsaxena

    Working on it

  • 🇮🇳India akulsaxena

    Hi @kellymjacobs, @robloach, @jspellman

    Since the MR!4 was failing at composer build, i didnt know if i should work on it.
    I worked on the last commit and tried to solve the phpcs errors and created a new MR.
    Can you please give it a look.

  • 🇮🇳India akulsaxena

    akulsaxena → changed the visibility of the branch 3359899-gitlab-ci-reports to active.

  • 🇮🇳India akulsaxena

    akulsaxena → changed the visibility of the branch 3359899-gitlab-ci-reports to hidden.

  • Pipeline finished with Failed
    17 days ago
    Total: 35s
    #329740
  • 🇮🇳India akulsaxena

    @kellymjacobs, @robloach, @jspellman

    I also worked on MR!4 and tried to solve all the phpcs issues as requested just in case the composer build failing is not an issue and a new MR is not required. The composer build is failing at MR!4 again but all the phpcs errors are now resolved.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The merge request to update is MR!5. the MR!4 was created to get the full list of PHP_CodeSniffer errors/warnings.

  • 🇮🇳India akulsaxena

    Hi @avpaderno
    Thanks for pointing out the mistakes
    Done with the suggested changes. Please give it a look.

Production build 0.71.5 2024