Drupal Coding Standards Issues | phpcs

Created on 9 January 2023, over 1 year ago
Updated 19 January 2023, over 1 year ago

Problem/Motivation

Getting following error/warnings

FILE: /app/modules/contrib/commerce_file/commerce_file.module
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------------------------
162 | WARNING | Line exceeds 80 characters; contains 90 characters
178 | WARNING | Line exceeds 80 characters; contains 98 characters
191 | ERROR | The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
----------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/commerce_file/src/Controller/FileDownloadController.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
182 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/commerce_file/src/LicenseFileManagerInterface.php
----------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------
10 | ERROR | [x] Missing interface doc comment
33 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/commerce_file/src/Plugin/Field/FieldWidget/DownloadLimitWidget.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------------
30 | ERROR | The array declaration extends to column 102 (the limit is 80). The array content should be split up over multiple lines
60 | WARNING | Unused variable $key.
----------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/commerce_file/tests/src/Functional/FileBrowserTestBase.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------
122 | ERROR | The array declaration extends to column 109 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/commerce_file/tests/src/Kernel/CommerceFileKernelTestBase.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------
20 | ERROR | [x] Expected "\Drupal\file\FileInterface" but found "\Drupal\file\FileInterface;" for @var tag in member variable comment
----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------

FILE: /app/modules/contrib/commerce_file/tests/src/Kernel/FileAccessTest.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------------------------------------------
22 | ERROR | The array declaration extends to column 91 (the limit is 80). The array content should be split up over multiple lines
35 | ERROR | The array declaration extends to column 93 (the limit is 80). The array content should be split up over multiple lines
39 | ERROR | The array declaration extends to column 98 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------

Time: 5.41 secs; Memory: 12MB

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

Proposed resolution

Above error/warnings need to be fixed

🐛 Bug report
Status

Closed: won't fix

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.

  • Status changed to Closed: won't fix over 1 year ago
Production build 0.69.0 2024