Fix the issues reported by phpcs

Created on 19 January 2023, almost 2 years ago
Updated 29 February 2024, 9 months ago
FILE: /var/www/web/modules/contrib/sendgrid_integration/modules/sendgrid_integration_reports/src/Form/SendGridReportsSettingsForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 9 WARNINGS AFFECTING 9 LINES
------------------------------------------------------------------------------------------------------------------------------------------
  73 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  79 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  83 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  88 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  92 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  98 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 101 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 116 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 143 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/sendgrid_integration/modules/sendgrid_integration_reports/src/Controller/SendGridReportsController.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 12 WARNINGS AFFECTING 13 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
  93 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 117 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 119 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 121 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 123 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 129 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 133 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 144 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 145 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 148 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 164 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 165 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 168 | 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: /var/www/web/modules/contrib/sendgrid_integration/modules/sendgrid_integration_reports/src/Api.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 4 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
  97 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 109 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 159 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 160 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 218 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 290 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 341 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/sendgrid_integration/sendgrid_integration.module
-----------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------
 22 | ERROR | [x] Object operator not indented correctly; expected 8 spaces but found 10
-----------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/sendgrid_integration/tests/sendgrid_integration.mail.test
--------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------
 24 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/sendgrid_integration/tests/sendgrid_integration.mail_test.test
-------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------
 24 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/sendgrid_integration/tests/sendgrid_integration.test
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 7 WARNINGS AFFECTING 11 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
 18 | ERROR   | [ ] Class property $admin_user should use lowerCamel naming without underscores
 25 | ERROR   | [ ] Class property $web_user should use lowerCamel naming without underscores
 41 | ERROR   | [x] Visibility must be declared on method "setUp"
 59 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 66 | ERROR   | [ ] Method name "SendgridIntegrationTestCase::testSendGridIntegrationAPISetup" is not in lowerCamel format
 66 | ERROR   | [x] Visibility must be declared on method "testSendGridIntegrationAPISetup"
 71 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 72 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 72 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 77 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 78 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 78 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 79 | ERROR   | [x] Expected 1 blank line after function; 2 found
 82 | ERROR   | [x] The closing brace for the class must have an empty line before it
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/sendgrid_integration/src/Form/SendGridSettingsForm.php
----------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------
  15 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
 109 | WARNING | [x] A comma should follow the last multiline array item. Found: 0
 116 | WARNING | [x] A comma should follow the last multiline array item. Found: 0
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/sendgrid_integration/src/Form/SendGridTestForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------
 115 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/sendgrid_integration/src/Plugin/Mail/SendGridMail.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 17 ERRORS AND 18 WARNINGS AFFECTING 31 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
  24 | WARNING | [x] Unused use statement
  42 | ERROR   | [x] Missing class doc comment
 141 | ERROR   | [x] There must be exactly one blank line before the tags in a doc comment
 144 | ERROR   | [x] Perl-style comments are not allowed; use "// Comment" instead
 147 | WARNING | [ ] Unused variable $sandbox_mode.
 201 | ERROR   | [x] Perl-style comments are not allowed; use "// Comment" instead
 250 | WARNING | [ ] Variable $data inside unset call is undefined.
 251 | ERROR   | [x] Perl-style comments are not allowed; use "// Comment" instead
 261 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 279 | WARNING | [ ] Line exceeds 80 characters; contains 91 characters
 290 | WARNING | [ ] Line exceeds 80 characters; contains 111 characters
 291 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 314 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 315 | ERROR   | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 325 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
 360 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
 366 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
 372 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
 387 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
 406 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
 408 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 413 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 414 | WARNING | [x] There must be no blank line following an inline comment
 414 | WARNING | [ ] There must be no blank line following an inline comment
 414 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 418 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 455 | WARNING | [x] There must be no blank line following an inline comment
 455 | WARNING | [ ] There must be no blank line following an inline comment
 477 | ERROR   | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 723 | WARNING | [ ] Line exceeds 80 characters; contains 95 characters
 724 | WARNING | [ ] Line exceeds 80 characters; contains 104 characters
 741 | ERROR   | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
 743 | ERROR   | [ ] Missing parameter comment
 743 | ERROR   | [x] Missing parameter type
 745 | ERROR   | [ ] Description for the @return value is missing
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 17 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/sendgrid_integration/CHANGELOG.md
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 52 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/sendgrid_integration/sendgrid_integration.api.php
----------------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 7 LINES
----------------------------------------------------------------------------------------------------------------------
 26 | ERROR | [ ] Type hint "array" missing for $unique_args
 26 | ERROR | [ ] Type hint "array" missing for $response
 35 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
 40 | ERROR | [ ] Parameter tags must be grouped together in a doc comment
 41 | ERROR | [x] Parameter comment must end with a full stop
 46 | ERROR | [ ] Type hint "array" missing for $unique_args
 46 | ERROR | [ ] Type hint "array" missing for $message
 55 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
 63 | ERROR | [ ] Type hint "array" missing for $categories
----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/sendgrid_integration/sendgrid_integration.install
------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------
 5 | ERROR | [x] Doc comment short description must end with a full stop
------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------


FILE: /var/www/web/modules/contrib/sendgrid_integration/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
 43 | WARNING | Line exceeds 80 characters; contains 81 characters
 68 | WARNING | Line exceeds 80 characters; contains 81 characters
----------------------------------------------------------------------

Time: 674ms; Memory: 16MB

Steps to reproduce

Run following command
phpcs --standard=โ€œDrupal,DrupalPracticeโ€ --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,css,js .

๐Ÿ“Œ Task
Status

Needs work

Version

2.0

Component

Code

Created by

๐Ÿ‡ฒ๐Ÿ‡ฉMoldova Sergiu Stici

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

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.

Production build 0.71.5 2024