Fix the issues reported by PHP_CodeSniffer

Created on 28 September 2024, about 2 months ago

Problem/Motivation

FILE: ad_inserter\ad_inserter.info.yml
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added by
| | drupal.org packaging automatically
1 | WARNING | Remove "datestamp" from the info file, it will be added by
| | drupal.org packaging automatically
1 | WARNING | Remove "version" from the info file, it will be added by
| | drupal.org packaging automatically
--------------------------------------------------------------------------------

FILE: ad_inserter\ad_inserter.module
--------------------------------------------------------------------------------
FOUND 10 ERRORS AFFECTING 8 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
38 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
54 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
55 | ERROR | [x] Expected 1 space after IF keyword; 0 found
55 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
| | found "false"
55 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
62 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 3 empty lines
64 | ERROR | [ ] More than 2 empty lines are not allowed
75 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 2 empty lines
83 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ad_inserter\ad_inserter.permissions.yml
---------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------
2 | ERROR | [x] Expected 1 newline at end of file; 2 found
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------

FILE: ...p64\www\d10_2_2\modules\ad_inserter\src\AdInserterAccessControlHandler.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
10 | ERROR | [x] Missing class doc comment
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ad_inserter\src\AdInserterListBuilder.php
------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
37 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------

FILE: ad_inserter\src\AdInserterStorage.php
--------------------------------------------------------------------------------
FOUND 10 ERRORS AFFECTING 7 LINES
--------------------------------------------------------------------------------
10 | ERROR | [x] Missing class doc comment
10 | ERROR | [x] Expected 1 space before opening brace; found 0
12 | ERROR | [ ] Missing short description in doc comment
13 | ERROR | [ ] Missing parameter comment
13 | ERROR | [ ] Missing parameter type
15 | ERROR | [ ] Description for the @return value is missing
15 | ERROR | [x] Data types in @return tags need to be fully namespaced
17 | ERROR | [x] Expected 1 space before opening brace; found 0
20 | ERROR | [x] Expected 1 blank line after function; 0 found
21 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ad_inserter\src\Entity\AdInserter.php
-------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
144 | ERROR | [x] Expected 1 blank line after function; 0 found
-------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------

FILE: ...\wamp64\www\d10_2_2\modules\ad_inserter\src\Entity\AdInserterInterface.php
--------------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 9 LINES
--------------------------------------------------------------------------------
10 | ERROR | [x] Missing interface doc comment
13 | ERROR | [x] Doc comment short description must end with a full stop
15 | ERROR | [ ] Description for the @return value is missing
20 | ERROR | [x] Doc comment short description must end with a full stop
22 | ERROR | [ ] Description for the @return value is missing
27 | ERROR | [x] Doc comment short description must end with a full stop
29 | ERROR | [ ] Description for the @return value is missing
34 | ERROR | [x] Doc comment short description must end with a full stop
36 | ERROR | [ ] Description for the @return value is missing
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...wamp64\www\d10_2_2\modules\ad_inserter\src\Form\AdInserterSettingsForm.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
8 | ERROR | [x] Missing class doc comment
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...4\www\d10_2_2\modules\ad_inserter\src\Plugin\Block\AdInserterBaseBlock.php
--------------------------------------------------------------------------------
FOUND 18 ERRORS AFFECTING 14 LINES
--------------------------------------------------------------------------------
14 | ERROR | [x] Missing class doc comment
16 | ERROR | [ ] Missing member variable doc comment
18 | ERROR | [ ] Missing short description in doc comment
23 | ERROR | [ ] Missing short description in doc comment
24 | ERROR | [x] Data types in @var tags need to be fully namespaced
24 | ERROR | [x] Data types in @var tags need to be fully namespaced
28 | ERROR | [ ] Missing member variable doc comment
30 | ERROR | [ ] Missing short description in doc comment
30 | ERROR | [ ] Parameter $moduleHandler is not described in comment
31 | ERROR | [ ] Missing parameter comment
32 | ERROR | [ ] Missing parameter comment
32 | ERROR | [ ] Missing parameter type
33 | ERROR | [ ] Missing parameter comment
33 | ERROR | [ ] Missing parameter type
34 | ERROR | [ ] Missing parameter comment
43 | ERROR | [x] Missing function doc comment
53 | ERROR | [x] Missing function doc comment
82 | ERROR | [x] Expected 1 blank line after function; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ..._2_2\modules\ad_inserter\src\Plugin\Block\AdInserterBaseBlockInterface.php
--------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------------
7 | ERROR | [x] Missing interface doc comment
10 | ERROR | [x] Doc comment short description must end with a full stop
12 | ERROR | [ ] Description for the @return value is missing
14 | ERROR | [x] Expected 1 blank line after function; 0 found
15 | ERROR | [x] The closing brace for the interface must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...amp64\www\d10_2_2\modules\ad_inserter\src\Plugin\Block\AdInserterBlock.php
--------------------------------------------------------------------------------
FOUND 6 ERRORS AND 1 WARNING AFFECTING 6 LINES
--------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
29 | ERROR | [x] Missing function doc comment
45 | ERROR | [x] Missing function doc comment
50 | ERROR | [x] Missing function doc comment
51 | ERROR | [x] Expected 1 space after IF keyword; 0 found
51 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
58 | ERROR | [x] Data types in @var tags need to be fully namespaced
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...10_2_2\modules\ad_inserter\src\Plugin\Block\AdInserterMachineNameBlock.php
--------------------------------------------------------------------------------
FOUND 8 ERRORS AND 1 WARNING AFFECTING 9 LINES
--------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
29 | ERROR | [x] Missing function doc comment
42 | ERROR | [x] Missing function doc comment
50 | ERROR | [x] Missing function doc comment
53 | ERROR | [x] Expected 1 blank line after function; 2 found
56 | ERROR | [x] Missing function doc comment
61 | ERROR | [x] Data types in @var tags need to be fully namespaced
64 | ERROR | [x] Expected 1 blank line after function; 0 found
65 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Steps to reproduce

Run phpcs command to get the drupal coding standard issues.

Proposed resolution

Many of the issues can be fixed by running the phpcbf command. For the remaining ones, we will need to manually address and then commit these changes before pushing them.

📌 Task
Status

Needs work

Version

1.0

Component

Code

Created by

🇺🇸United States sunil jolapara 3265 Summitrun Drive, Independence, KY, 41051

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024