Fix the issues reported by phpcs

Created on 17 February 2023, over 1 year ago
Updated 19 February 2023, over 1 year ago

Problem/Motivation

FILE: ...:\xampp\htdocs\abc\drupal\modules\cron_timing\cron_timing.module
----------------------------------------------------------------------
FOUND 14 ERRORS AND 1 WARNING AFFECTING 9 LINES
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n"
| | but found "\r\n"
31 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 3
31 | WARNING | [ ] Line exceeds 80 characters; contains 128
| | characters
31 | ERROR | [x] Inline comments must end in full-stops,
| | exclamation marks, question marks, colons, or
| | closing parentheses
31 | ERROR | [x] Comments may not appear after statements
32 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 3
32 | ERROR | [x] Expected 1 space after closing parenthesis; found
| | 0
33 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 6
33 | ERROR | [x] Expected 1 space after "="; 2 found
34 | ERROR | [x] Line indented incorrectly; expected 4 spaces,
| | found 6
34 | ERROR | [ ] The array declaration extends to column 85 (the
| | limit is 80). The array content should be split
| | up over multiple lines
35 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 3
36 | ERROR | [x] Line indented incorrectly; expected 2 spaces,
| | found 3
37 | ERROR | [x] There should be no white space after an opening
| | "("
39 | ERROR | [x] Closing brace indented incorrectly; expected 3
| | spaces, found 2
----------------------------------------------------------------------
PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: C:\xampp\htdocs\abc\drupal\modules\cron_timing\README.txt
----------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
----------------------------------------------------------------------
32 | WARNING | Line exceeds 80 characters; contains 187 characters
38 | WARNING | Line exceeds 80 characters; contains 133 characters
44 | WARNING | Line exceeds 80 characters; contains 120 characters
45 | WARNING | Line exceeds 80 characters; contains 116 characters
----------------------------------------------------------------------

FILE: ...pp\htdocs\abc\drupal\modules\cron_timing\src\Form\CronTiming.php
----------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 3 LINES
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n"
| | but found "\r\n"
10 | WARNING | [ ] The class short comment should describe what the
| | class does and not simply repeat the class name
49 | ERROR | [x] Expected 1 space after IF keyword; 0 found
49 | ERROR | [x] Expected one space after the comma, 0 found
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Steps to reproduce

Run the following command :
phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml /10.1.x/drupal/modules/contrib/cron_timing

Proposed resolution

Fix all the PHP coding standard issues.

📌 Task
Status

Fixed

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.69.0 2024