Drupal Coding Standards Issues | phpcs

Created on 4 January 2023, over 1 year ago
Updated 23 January 2023, over 1 year ago

Problem/Motivation

Getting following error/warnings

FILE: /app/modules/contrib/http_cache_control/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------
15 | WARNING | Line exceeds 80 characters; contains 84 characters
37 | WARNING | Line exceeds 80 characters; contains 86 characters
39 | WARNING | Line exceeds 80 characters; contains 83 characters
46 | WARNING | Line exceeds 80 characters; contains 109 characters
----------------------------------------------------------------------

FILE: /app/modules/contrib/http_cache_control/http_cache_control.info.yml
-----------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
-----------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/http_cache_control/http_cache_control.module
------------------------------------------------------------------------------------
FOUND 14 ERRORS AND 1 WARNING AFFECTING 14 LINES
------------------------------------------------------------------------------------
10 | WARNING | [x] Unused use statement
10 | ERROR | [x] When importing a class with "use", do not include a leading \
26 | ERROR | [x] Expected 1 blank line after function; 2 found
102 | ERROR | [x] Array indentation error, expected 4 spaces but found 6
103 | ERROR | [x] Array indentation error, expected 4 spaces but found 6
104 | ERROR | [x] Array indentation error, expected 4 spaces but found 6
105 | ERROR | [x] Array closing indentation error, expected 2 spaces but found 4
123 | ERROR | [x] Array indentation error, expected 4 spaces but found 6
124 | ERROR | [x] Array indentation error, expected 4 spaces but found 6
125 | ERROR | [x] Array indentation error, expected 4 spaces but found 6
126 | ERROR | [x] Array closing indentation error, expected 2 spaces but found 4
145 | ERROR | [x] Array indentation error, expected 4 spaces but found 6
146 | ERROR | [x] Array indentation error, expected 4 spaces but found 6
147 | ERROR | [x] Array indentation error, expected 4 spaces but found 6
148 | ERROR | [x] Array closing indentation error, expected 2 spaces but found 4
------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 15 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------

FILE: /app/modules/contrib/http_cache_control/tests/src/HttpCacheControlTest.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 7 LINES
--------------------------------------------------------------------------------------------------------------------------------------
14 | ERROR | Missing member variable doc comment
26 | ERROR | The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
49 | ERROR | The array declaration extends to column 99 (the limit is 80). The array content should be split up over multiple lines
49 | ERROR | The array declaration extends to column 98 (the limit is 80). The array content should be split up over multiple lines
59 | ERROR | The array declaration extends to column 100 (the limit is 80). The array content should be split up over multiple lines
59 | ERROR | The array declaration extends to column 99 (the limit is 80). The array content should be split up over multiple lines
72 | ERROR | The array declaration extends to column 96 (the limit is 80). The array content should be split up over multiple lines
72 | ERROR | The array declaration extends to column 95 (the limit is 80). The array content should be split up over multiple lines
79 | ERROR | The array declaration extends to column 109 (the limit is 80). The array content should be split up over multiple lines
79 | ERROR | The array declaration extends to column 108 (the limit is 80). The array content should be split up over multiple lines
86 | ERROR | The array declaration extends to column 109 (the limit is 80). The array content should be split up over multiple lines
86 | ERROR | The array declaration extends to column 108 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------

Time: 1.04 secs; Memory: 10MB

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/http_cache_control/

Proposed resolution

Above error/warnings need to be fixed

🐛 Bug report
Status

RTBC

Version

2.0

Component

Code

Created by

🇮🇳India samit.310@gmail.com

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

Comments & Activities

Not all content is available!

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

Production build 0.69.0 2024