Drupal Coding Standards Issues | phpcs

Created on 19 January 2023, over 2 years ago

Problem/Motivation

Getting following error/warnings

FILE: /var/www/html/modules/contrib/confi/config_import.drush.inc
-------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 3 WARNINGS AFFECTING 6 LINES
-------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
1 | ERROR | [x] Missing file doc comment
17 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
108 | WARNING | [ ] Unused variable $entity_type.
144 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
201 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
248 | WARNING | [ ] Unused variable $i.
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/confi/tests/modules/config_import_test/config_import_test.info.yml
------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------
1 | WARNING | "Description" property is missing in the info.yml file
1 | WARNING | "core_version_requirement" property is missing in the info.yml file
7 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/confi/tests/src/Unit/ConfigImporterServiceTestBase.php
------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
------------------------------------------------------------------------------------------
8 | WARNING | [x] Unused use statement
52 | ERROR | [ ] Type hint "array" missing for $arguments
71 | ERROR | [ ] Type hint "array" missing for $arguments
81 | ERROR | [x] Data types in @return tags need to be fully namespaced
------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/confi/tests/src/Unit/ConfigFeaturesImporterServiceTest.php
-------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------
18 | ERROR | [ ] Do not disable strict config schema checking in tests. Instead ensure your module properly declares its schema for configurations.
40 | WARNING | [x] There must be no blank line following an inline comment
40 | WARNING | [ ] There must be no blank line following an inline comment
-------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/confi/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------
3 | WARNING | Line exceeds 80 characters; contains 100 characters
5 | WARNING | Line exceeds 80 characters; contains 151 characters
11 | WARNING | Line exceeds 80 characters; contains 87 characters
48 | WARNING | Line exceeds 80 characters; contains 90 characters
66 | WARNING | Line exceeds 80 characters; contains 82 characters
----------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/confi/src/ConfigImporterService.php
----------------------------------------------------------------------------------------------------------------------
FOUND 30 ERRORS AND 5 WARNINGS AFFECTING 32 LINES
----------------------------------------------------------------------------------------------------------------------
16 | WARNING | [x] Unused use statement
17 | WARNING | [x] Unused use statement
18 | WARNING | [x] Unused use statement
30 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
36 | ERROR | [x] Data types in @var tags need to be fully namespaced
42 | ERROR | [x] Data types in @var tags need to be fully namespaced
48 | ERROR | [x] Data types in @var tags need to be fully namespaced
54 | ERROR | [x] Data types in @var tags need to be fully namespaced
60 | ERROR | [x] Data types in @var tags need to be fully namespaced
66 | ERROR | [x] Data types in @var tags need to be fully namespaced
72 | ERROR | [x] Data types in @var tags need to be fully namespaced
78 | ERROR | [x] Data types in @var tags need to be fully namespaced
84 | ERROR | [x] Data types in @var tags need to be fully namespaced
90 | ERROR | [x] Data types in @var tags need to be fully namespaced
96 | ERROR | [x] Data types in @var tags need to be fully namespaced
96 | ERROR | [x] Data types in @var tags need to be fully namespaced
115 | ERROR | [x] Data types in @param tags need to be fully namespaced
117 | ERROR | [x] Data types in @param tags need to be fully namespaced
119 | ERROR | [x] Data types in @param tags need to be fully namespaced
121 | ERROR | [x] Data types in @param tags need to be fully namespaced
123 | ERROR | [x] Data types in @param tags need to be fully namespaced
125 | ERROR | [x] Data types in @param tags need to be fully namespaced
127 | ERROR | [x] Data types in @param tags need to be fully namespaced
129 | ERROR | [x] Data types in @param tags need to be fully namespaced
131 | ERROR | [x] Data types in @param tags need to be fully namespaced
133 | ERROR | [x] Data types in @param tags need to be fully namespaced
135 | ERROR | [x] Data types in @param tags need to be fully namespaced
135 | ERROR | [x] Data types in @param tags need to be fully namespaced
153 | ERROR | [x] Blank lines are not allowed in a multi-line function declaration
153 | ERROR | [x] Whitespace found at end of line
174 | ERROR | [x] There should be no white space before a closing ")"
244 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
277 | ERROR | [x] Data types in @param tags need to be fully namespaced
295 | ERROR | [x] Data types in @param tags need to be fully namespaced
307 | ERROR | [x] Data types in @param tags need to be fully namespaced
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 33 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/confi/src/ConfigImportServiceProvider.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------
10 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
16 | ERROR | [x] Data types in @var tags need to be fully namespaced
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/confi/src/ConfigFeaturesImporterService.php
----------------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 2 WARNINGS AFFECTING 11 LINES
----------------------------------------------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
16 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
22 | ERROR | [x] Data types in @var tags need to be fully namespaced
28 | ERROR | [x] Data types in @var tags need to be fully namespaced
34 | ERROR | [x] Data types in @var tags need to be fully namespaced
40 | ERROR | [x] Data types in @var tags need to be fully namespaced
47 | ERROR | [x] Data types in @param tags need to be fully namespaced
49 | ERROR | [x] Data types in @param tags need to be fully namespaced
51 | ERROR | [x] Data types in @param tags need to be fully namespaced
53 | ERROR | [x] Data types in @param tags need to be fully namespaced
110 | ERROR | [x] Data types in @param tags need to be fully namespaced
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/confi/src/ConfigFeaturesImporterServiceInterface.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
9 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/confi/src/ConfigImporterServiceInterface.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
9 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/confi/src/ConfigParamUpdaterService.php
---------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------------------------
13 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
21 | ERROR | [x] Data types in @var tags need to be fully namespaced
34 | ERROR | [x] Data types in @param tags need to be fully namespaced
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/confi/src/Drush/Command.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
11 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

Time: 2.59 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/confi/

Proposed resolution

Above error/warnings need to be fixed.

🐛 Bug report
Status

RTBC

Version

3.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.

  • Issue was unassigned.
  • Status changed to RTBC over 2 years ago
Production build 0.71.5 2024