Fix the issues reported by phpcs

Created on 12 May 2023, over 1 year ago
Updated 15 May 2023, over 1 year ago

Problem/Motivation

Module's code contains several Drupal Coding Standards issues. This task is created to fix them.

Steps to reproduce

Run the command:

phpcs --standard=Drupal
/web/modules/contrib/unified_mail_dispatcher/

Proposed resolution

Fix the following coding standards issues and upload the patch or create an MR with fixes.

FILE: \modules\contrib\unified_mail_dispatcher\src\DiscordManager.php
---------------------------------------------------------------------------------------------------------------------
FOUND 26 ERRORS AND 1 WARNING AFFECTING 26 LINES
---------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
12 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
15 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
17 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
22 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
24 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
29 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
31 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
34 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
35 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
36 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
37 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
39 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
50 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
51 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
52 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
53 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
56 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 12
57 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 12
58 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 16
59 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 12
60 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
60 | ERROR | [x] Expected newline after closing brace
61 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
62 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
64 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
65 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
---------------------------------------------------------------------------------------------------------------------

FILE: \modules\contrib\unified_mail_dispatcher\src\Form\UnifiedMailDispatcherSettingsForm.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 52 ERRORS AFFECTING 50 LINES
-----------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
8 | ERROR | [x] Missing class doc comment
10 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
13 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
14 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
15 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
17 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
20 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
21 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
22 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
24 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
24 | ERROR | [x] Missing function doc comment
25 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
27 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
28 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
29 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
30 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
33 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
34 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
35 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
36 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
37 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
38 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
40 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
41 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
42 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
43 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
48 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
49 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
50 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
51 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
52 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
53 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
54 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
55 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
60 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
61 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
62 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
63 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
64 | ERROR | [x] Array indentation error, expected 10 spaces but found 12
65 | ERROR | [x] Array indentation error, expected 14 spaces but found 16
66 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
67 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
72 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
73 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
75 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
78 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
78 | ERROR | [x] Expected 1 space between type hint and argument "$form"; 0 found
79 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
80 | ERROR | [x] Object operator not indented correctly; expected 10 spaces but found 12
86 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
87 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
-----------------------------------------------------------------------------------------------------------------------------

FILE: \modules\contrib\unified_mail_dispatcher\src\UnifiedMailManager.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 31 ERRORS AND 1 WARNING AFFECTING 25 LINES
------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
9 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
12 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
12 | ERROR | [x] Missing function doc comment
13 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
14 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
16 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
17 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
18 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
19 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
19 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
20 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
21 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
23 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
23 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
24 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
25 | ERROR | [x] Array indentation error, expected 18 spaces but found 20
27 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
29 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
30 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
30 | ERROR | [x] Expected newline after closing brace
31 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
31 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
32 | ERROR | [x] Line indented incorrectly; expected 8 spaces, found 16
33 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 12
34 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
35 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
35 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
36 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
37 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
37 | ERROR | [x] Expected 1 blank line after function; 0 found
38 | ERROR | [x] The closing brace for the class must have an empty line before it
------------------------------------------------------------------------------------------------------------------------------

📌 Task
Status

Fixed

Component

Code

Created by

🇮🇳India Shanu Chouhan

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

Production build 0.71.5 2024