Drupal Coding Standards Issues | phpcs

Created on 24 January 2023, almost 2 years ago
Updated 1 February 2023, almost 2 years ago

Problem/Motivation

Getting following error/warnings

FILE: ...op\task\admin_receipt_mail\src\EventSubscriber\OrderCompleteSubscriber.php
--------------------------------------------------------------------------------
FOUND 16 ERRORS AND 3 WARNINGS AFFECTING 13 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found
| | "\r\n"
14 | WARNING | [ ] The class short comment should describe what the class does
| | and not simply repeat the class name
42 | ERROR | [x] Expected 1 blank line after function; 0 found
46 | ERROR | [x] Visibility must be declared on method "getSubscribedEvents"
47 | ERROR | [ ] The array declaration extends to column 88 (the limit is
| | 80). The array content should be split up over multiple
| | lines
47 | ERROR | [ ] The array declaration extends to column 87 (the limit is
| | 80). The array content should be split up over multiple
| | lines
52 | WARNING | [ ] Line exceeds 80 characters; contains 85 characters
53 | ERROR | [ ] Doc comment short description must be on a single line,
| | further text should be a separate paragraph
55 | ERROR | [ ] Missing parameter comment
55 | ERROR | [x] Data types in @param tags need to be fully namespaced
62 | ERROR | [x] Inline comments must start with a capital letter
63 | WARNING | [x] There must be no blank line following an inline comment
63 | ERROR | [x] Whitespace found at end of line
65 | ERROR | [x] No space found before comment text; expected "//
| | configration mail id" but found "//configration mail id"
65 | ERROR | [x] Inline comments must start with a capital letter
65 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
65 | ERROR | [x] Whitespace found at end of line
67 | ERROR | [x] Functions must not contain multiple empty lines in a row;
| | found 2 empty lines
78 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...\Users\Admin\Desktop\task\admin_receipt_mail\src\Mail\OrderReceiptMail.php
--------------------------------------------------------------------------------
FOUND 5 ERRORS AND 1 WARNING AFFECTING 5 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found
| | "\r\n"
10 | WARNING | [x] Unused use statement
10 | ERROR | [x] There must be one blank line after the last USE statement;
| | 2 found;
13 | ERROR | [x] Missing class doc comment
60 | ERROR | [x] Whitespace found at end of line
61 | ERROR | [x] Use null coalesce operator instead of ternary operator.
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...min\Desktop\task\admin_receipt_mail\src\Mail\OrderReceiptMailInterface.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found
| | "\r\n"
7 | ERROR | [x] Missing interface doc comment
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...rs\Admin\Desktop\task\admin_receipt_mail\tests\src\Functional\LoadTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found
| | "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 449ms; Memory: 8MB

Proposed resolution

Above error/warnings need to be fixed

🐛 Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

🇮🇳India Charchil Khandelwal

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024