Fix the issue reported by phpcs.

Created on 5 July 2023, 12 months ago
Updated 10 July 2023, 12 months ago

Problem/Motivation

Getting following error/warnings:

FILE: D:\xampp\htdocs\project_10\web\modules\contrib\token_aliases\README.md
----------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
----------------------------------------------------------------------------
3 | WARNING | Line exceeds 80 characters; contains 109 characters
6 | WARNING | Line exceeds 80 characters; contains 125 characters
7 | WARNING | Line exceeds 80 characters; contains 83 characters
----------------------------------------------------------------------------

FILE: D:\xampp\htdocs\project_10\web\modules\contrib\token_aliases\src\Utility\TokenAlias.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 17 ERRORS AND 6 WARNINGS AFFECTING 21 LINES
-------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
9 | WARNING | [ ] Line exceeds 80 characters; contains 102 characters
11 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
72 | ERROR | [x] Missing function doc comment
72 | ERROR | [x] Expected 1 blank line before function; 0 found
82 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
83 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
84 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
85 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
87 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
88 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
91 | WARNING | [ ] Line exceeds 80 characters; contains 89 characters
94 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
103 | WARNING | [ ] Line exceeds 80 characters; contains 108 characters
111 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
121 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
125 | WARNING | [ ] Line exceeds 80 characters; contains 92 characters
128 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
136 | WARNING | [ ] Line exceeds 80 characters; contains 90 characters
137 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
158 | ERROR | [x] Expected 1 blank line after function; 0 found
159 | ERROR | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 16 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run following command:

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml token_aliases/

Proposed resolution

Above error/warnings need to be fixed.

📌 Task
Status

Closed: outdated

Version

1.0

Component

Code

Created by

🇮🇳India arti_parmar

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

Comments & Activities

Production build 0.69.0 2024