Drupal calls should be avoided in classes, use dependency injection instead.

Created on 16 September 2023, over 1 year ago
Updated 11 July 2024, 5 months ago

Problem/Motivation

FILE: /var/www/html/drupal_9.4/drupal/web/modules/contrib/postmark/src/Form/PostmarkSettingsForm.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------------------------------
  65 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 112 | ERROR   | [x] Whitespace found at end of line
 119 | WARNING | [ ] Possible useless method overriding detected
 144 | ERROR   | [x] Whitespace found at end of line
-------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal_9.4/drupal/web/modules/contrib/postmark/src/PostmarkHandler.php
----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------
  77 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 189 | WARNING | Unused variable $postmark.
----------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal_9.4/drupal/web/modules/contrib/postmark/src/Plugin/Mail/PostmarkMail.php
---------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------
 10 | WARNING | [x] Unused use statement
---------------------------------------------------------------------------------------------------

Time: 151ms; Memory: 12MB

šŸ“Œ Task
Status

Needs review

Version

1.0

Component

Code

Created by

šŸ‡®šŸ‡³India Rohit Rana

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.

Sign in to follow issues

Comments & Activities

  • Issue created by @Rohit Rana
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡³India Ashutosh Ahirwal India

    Provided patch in #2 applied cleanly but still there are some issue remains
    Providing updated patch with all fixes.

  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @Ashutosh Ahirwal,

    I applied your patch, it was applied smoothly and fixed the phpcs issues.

    āžœ  postmark git:(8.x-1.3) curl https://www.drupal.org/files/issues/2024-01-24/phpcs-issue-fixes_0.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  6044  100  6044    0     0  13596      0 --:--:-- --:--:-- --:--:-- 13582
    patching file README.md
    patching file postmark.services.yml
    patching file src/Form/PostmarkSettingsForm.php
    patching file src/Plugin/Mail/PostmarkMail.php
    patching file src/PostmarkHandler.php
    āžœ  postmark git:(8.x-1.3) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml postmark
    āžœ  contrib git:(main) āœ—

    Thank you.

Production build 0.71.5 2024