Fix the issues reported by phpcs

Created on 10 July 2023, 12 months ago
Updated 13 February 2024, 5 months ago

Problem/Motivation

FILE: /var/www/html/vb/d_cont/azure_mailer/README.txt
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
15 | ERROR | [x] Expected 1 newline at end of file; 0 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/azure_mailer/src/Form/AzureMailerSettingsForm.php
--------------------------------------------------------------------------------
FOUND 5 ERRORS AND 2 WARNINGS AFFECTING 7 LINES
--------------------------------------------------------------------------------
8 | ERROR | [x] Missing class doc comment
29 | ERROR | [ ] Concatenating translatable strings is not allowed, use
| | placeholders instead and only one string literal
31 | WARNING | [x] A comma should follow the last multiline array item. Found:
| | 'yoursite.communication.azure.com'
41 | ERROR | [ ] Concatenating translatable strings is not allowed, use
| | placeholders instead and only one string literal
44 | WARNING | [x] A comma should follow the last multiline array item. Found:
| | "\$config['azure_mailer.settings']['secret'] =
| | 'yoursecret';"
77 | ERROR | [x] Expected 1 blank line after function; 0 found
78 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/azure_mailer/src/Plugin/Mail/AzureMailer.php
--------------------------------------------------------------------------------
FOUND 12 ERRORS AND 1 WARNING AFFECTING 12 LINES
--------------------------------------------------------------------------------
11 | WARNING | [x] Unused use statement
24 | ERROR | [ ] Missing short description in doc comment
32 | ERROR | [ ] Missing short description in doc comment
49 | ERROR | [x] No space found before comment text; expected "//
| | 'attachments' => []," but found "//'attachments' => [],"
68 | ERROR | [x] Array indentation error, expected 8 spaces but found 12
69 | ERROR | [x] Array indentation error, expected 8 spaces but found 10
69 | ERROR | [x] Whitespace found at end of line
70 | ERROR | [x] Array indentation error, expected 8 spaces but found 12
71 | ERROR | [x] Array indentation error, expected 8 spaces but found 10
91 | ERROR | [x] Short array syntax must be used to define arrays
92 | ERROR | [x] Array indentation error, expected 12 spaces but found 14
96 | ERROR | [x] Whitespace found at end of line
99 | ERROR | [x] Expected 1 space after CATCH keyword; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...r/www/html/vb/d_cont/azure_mailer/config/install/azure_mailer.settings.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
2 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 73ms; Memory: 10MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig azure_mailer/

Remaining tasks

Patch review

šŸ“Œ Task
Status

Closed: outdated

Version

1.0

Component

Code

Created by

šŸ‡®šŸ‡³India urvashi_vora Madhya Pradesh, India

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 @urvashi_vora
  • šŸ‡®šŸ‡³India Ashutosh Ahirwal India

    I have reviewed provided patch.
    One error remaining after patch applied cleanly.

    Remaining issue

    FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/azure_mailer/src/Plugin/Mail/AzureMailer.php
    ------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------
    6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Mail\MailInterface.
    ------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------

    Time: 101ms; Memory: 10MB

    Providing updated patch.

  • Status changed to RTBC 9 months ago
  • šŸ‡µšŸ‡­Philippines clarkssquared

    Hi Ashutosh Ahirwal,

    I applied and tested your patch #2 and I confirmed that it fixes all the PHPCS issue, below is the output from my terminal

    āžœ  azure_mailer git:(1.0.x) curl https://www.drupal.org/files/issues/2023-09-29/phpcs-issue-fixes_1.patch | git apply -v
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  4975  100  4975    0     0  17452      0 --:--:-- --:--:-- --:--:-- 17895
    Checking patch README.txt...
    Checking patch config/install/azure_mailer.settings.yml...
    Checking patch src/Form/AzureMailerSettingsForm.php...
    Checking patch src/Plugin/Mail/AzureMailer.php...
    Applied patch README.txt cleanly.
    Applied patch config/install/azure_mailer.settings.yml cleanly.
    Applied patch src/Form/AzureMailerSettingsForm.php cleanly.
    Applied patch src/Plugin/Mail/AzureMailer.php cleanly.
    āžœ  azure_mailer git:(1.0.x) āœ— .. 
    āžœ  ~ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml azure_mailer 
    āžœ  ~ 
  • Status changed to Closed: outdated 5 months ago
  • šŸ‡ŗšŸ‡øUnited States smustgrave

    Since these are pretty much seen as credit farming tickets I'm going to close out and will address findings in the gitlab ticket.

Production build 0.69.0 2024