Problem/Motivation
Getting following error/warnings
FILE: /app/modules/contrib/mass_contact/mass_contact.install
------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------
25 | ERROR | [x] Whitespace found at end of line
30 | ERROR | [x] No space found before comment text; expected "// Removing mass_contact_opt_out field." but found "//Removing mass_contact_opt_out field."
------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /app/modules/contrib/mass_contact/mass_contact.module
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
55 | ERROR | The array declaration extends to column 249 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------
FILE: /app/modules/contrib/mass_contact/src/Form/AdminSettingsForm.php
---------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------------
114 | WARNING | #options values usually have to run through t() for translation
115 | WARNING | #options values usually have to run through t() for translation
---------------------------------------------------------------------------------
FILE: /app/modules/contrib/mass_contact/src/Form/CategoryForm.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
15 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
138 | WARNING | [ ] Line exceeds 80 characters; contains 111 characters
138 | WARNING | [x] 'TODO: Drupal Rector Notice: Please delete the following comment after you've made any necessary changes.' should match the format '@todo Fix problem
| | X here.'
139 | WARNING | [ ] Line exceeds 80 characters; contains 218 characters
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /app/modules/contrib/mass_contact/src/Form/EmailBodyForm.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------
111 | ERROR | The array declaration extends to column 343 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------------------------------
FILE: /app/modules/contrib/mass_contact/src/Form/MassContactForm.php
--------------------------------------------------------------------------------------------------
FOUND 10 ERRORS AND 1 WARNING AFFECTING 10 LINES
--------------------------------------------------------------------------------------------------
53 | ERROR | [ ] Missing parameter comment
53 | ERROR | [x] Expected 1 spaces after parameter type; 10 found
56 | ERROR | [x] Expected 1 spaces after parameter type; 10 found
58 | ERROR | [x] Expected 1 spaces after parameter type; 10 found
60 | ERROR | [x] Expected 1 spaces after parameter type; 9 found
62 | ERROR | [x] Expected 1 spaces after parameter type; 14 found
175 | ERROR | [ ] Unnecessarily gendered language in a comment
265 | ERROR | [x] Array indentation error, expected 10 spaces but found 8
266 | ERROR | [x] Array indentation error, expected 10 spaces but found 8
345 | ERROR | [x] Array indentation error, expected 10 spaces but found 8
430 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------
FILE: /app/modules/contrib/mass_contact/src/MassContact.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------
280 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
----------------------------------------------------------------------------------------------
FILE: /app/modules/contrib/mass_contact/src/Plugin/MassContact/GroupingMethod/Role.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------
142 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------
FILE: /app/modules/contrib/mass_contact/src/Tests/Form/EmailBodyFormTest.php
----------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------
34 | WARNING | '@todo' should match the format '@todo Fix problem X here.'
----------------------------------------------------------------------------
FILE: /app/modules/contrib/mass_contact/tests/src/Functional/Form/CategoryFormTest.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 10 WARNINGS AFFECTING 10 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
26 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
27 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
30 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
33 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
36 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
37 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
50 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
71 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
97 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------
FILE: /app/modules/contrib/mass_contact/tests/src/Functional/Form/MassContactFormTest.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 9 WARNINGS AFFECTING 10 LINES
------------------------------------------------------------------------------------------------------------------------------------------
55 | ERROR | The array declaration extends to column 116 (the limit is 80). The array content should be split up over multiple lines
147 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
184 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
193 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
230 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
261 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
272 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
305 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
336 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
457 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------
FILE: /app/modules/contrib/mass_contact/tests/src/Kernel/CategoryAccessControlHandlerTest.php
---------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
3 | ERROR | [x] There must be one blank line after the namespace declaration
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------
FILE: /app/modules/contrib/mass_contact/tests/src/Kernel/CategoryCreationTrait.php
----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------
FILE: /app/modules/contrib/mass_contact/tests/src/Kernel/Entity/MassContactCategoryTest.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
67 | ERROR | The array declaration extends to column 115 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------
FILE: /app/modules/contrib/mass_contact/tests/src/Kernel/OptOutTest.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------
152 | ERROR | The array declaration extends to column 107 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------------------------------
FILE: /app/modules/contrib/mass_contact/tests/src/Unit/MassContactTest.php
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
31 | ERROR | [x] Expected 1 blank line before function; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------
Time: 6.14 secs; Memory: 14MB
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/mass_contact/
Proposed resolution
Above error/warnings need to be fixed