Fix the issues reported by PHP_CodeSniffer

Created on 28 September 2024, 3 months ago

Problem/Motivation

FILE: modules\bulk_invite\bulk_invite.install
-------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
6 | ERROR | [x] Doc comment short description must end with a full stop
-------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------

FILE: modules\bulk_invite\bulk_invite.module
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
6 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements
| | hook_foo_BAR_ID_bar() for block templates."
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

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

FILE: modules\bulk_invite\config\install\bulk_invite.mail.yml
-------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------
3 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------

FILE: modules\bulk_invite\config\schema\bulk_invite.schema.yml
--------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------
7 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------

FILE: modules\bulk_invite\README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
5 | WARNING | Line exceeds 80 characters; contains 101 characters
----------------------------------------------------------------------

FILE: modules\bulk_invite\src\Controller\UsersInvitedController.php
----------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 2 WARNINGS AFFECTING 9 LINES
----------------------------------------------------------------------------------------------------------------------
11 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\user\Entity\User.
12 | WARNING | [x] Unused use statement
18 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
30 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
40 | ERROR | [ ] Parameter tags must be grouped together in a doc comment
40 | ERROR | [ ] Missing parameter comment
74 | ERROR | [x] There should be no white space after an opening "("
75 | ERROR | [x] There should be no white space after an opening "("
145 | ERROR | [x] There should be no white space after an opening "("
146 | ERROR | [x] There should be no white space after an opening "("
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------

FILE: modules\bulk_invite\src\Form\BulkInviteForm.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 13 ERRORS AND 2 WARNINGS AFFECTING 11 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\user\Entity\User.
12 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
15 | ERROR | [ ] Missing member variable doc comment
15 | ERROR | [ ] Class property $invalid_emails should use lowerCamel naming without underscores
16 | ERROR | [ ] Missing member variable doc comment
16 | ERROR | [ ] Class property $invitations_sent should use lowerCamel naming without underscores
17 | ERROR | [ ] Missing member variable doc comment
39 | ERROR | [x] Short array syntax must be used to define arrays
45 | ERROR | [x] Short array syntax must be used to define arrays
61 | ERROR | [x] Expected newline after closing brace
89 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
89 | ERROR | [ ] Description for the @return value must be on the next line
107 | ERROR | [ ] The array declaration extends to column 168 (the limit is 120). The array content should be split up over multiple lines
135 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for variables
135 | ERROR | [ ] The array declaration extends to column 133 (the limit is 120). The array content should be split up over multiple lines
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------

FILE: modules\bulk_invite\tests\src\Functional\SendInvitationsTest.php
---------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Test\AssertMailTrait.
75 | ERROR | [x] Expected 1 newline at end of file; 2 found
---------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 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

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