Drupal Coding Standards Issues | phpcs

Created on 7 March 2023, over 1 year ago
Updated 8 March 2023, over 1 year ago

Problem/Motivation

Getting following error/warnings.

FILE: /var/www/html/modules/contrib/facebook_comments_block/facebook_comments_block.module
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------------------------------------------
52 | WARNING | [x] A comma should follow the last multiline array item. Found: 'block--facebook-comments-block'
53 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
74 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
76 | ERROR | [ ] The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/facebook_comments_block/src/Plugin/Block/FacebookCommentsBlock.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 13 ERRORS AND 2 WARNINGS AFFECTING 15 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
268 | ERROR | [ ] The array declaration extends to column 146 (the limit is 80). The array content should be split up over multiple lines
269 | ERROR | [ ] The array declaration extends to column 158 (the limit is 80). The array content should be split up over multiple lines
270 | ERROR | [ ] The array declaration extends to column 142 (the limit is 80). The array content should be split up over multiple lines
271 | ERROR | [ ] The array declaration extends to column 158 (the limit is 80). The array content should be split up over multiple lines
272 | ERROR | [ ] The array declaration extends to column 144 (the limit is 80). The array content should be split up over multiple lines
273 | ERROR | [ ] The array declaration extends to column 164 (the limit is 80). The array content should be split up over multiple lines
274 | ERROR | [ ] The array declaration extends to column 154 (the limit is 80). The array content should be split up over multiple lines
275 | ERROR | [ ] The array declaration extends to column 144 (the limit is 80). The array content should be split up over multiple lines
284 | ERROR | [ ] The array declaration extends to column 114 (the limit is 80). The array content should be split up over multiple lines
290 | ERROR | [ ] The array declaration extends to column 127 (the limit is 80). The array content should be split up over multiple lines
296 | ERROR | [ ] The array declaration extends to column 107 (the limit is 80). The array content should be split up over multiple lines
309 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
310 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
327 | ERROR | [x] Expected newline after closing brace
333 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------

Time: 1.01 secs; Memory: 6MB

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

Proposed resolution

Above error/warnings need to be fixed.

📌 Task
Status

RTBC

Version

2.0

Component

Code

Created by

🇮🇳India samit.310@gmail.com

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

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

Sign in to follow issues

Comments & Activities

Not all content is available!

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

Production build 0.69.0 2024