Drupal Coding Standards Issues | phpcs

Created on 25 January 2023, almost 2 years ago
Updated 7 October 2023, about 1 year ago

Problem/Motivation

Getting Following errors/warnings

$ phpcs --standard=Drupal simple_wysiwyg

FILE: C:\Users\Admin\Desktop\task\simple_wysiwyg\css\simple-wysiwyg.css
--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------


FILE: C:\Users\Admin\Desktop\task\simple_wysiwyg\js\simple-wysiwyg.js
--------------------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 11 LINES
--------------------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n" but found
     |       |     "\r\n"
  56 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
  65 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  66 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  73 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
  82 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  84 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
 141 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
 160 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
 160 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but
     |       |     found "null"
 171 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
 174 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...\simple_wysiwyg\src\Plugin\Field\FieldFormatter\SimpleWysiwygFormatter.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
--------------------------------------------------------------------------------


FILE: ...p\task\simple_wysiwyg\src\Plugin\Field\FieldWidget\SimpleWysiwygWidget.php
--------------------------------------------------------------------------------
FOUND 6 ERRORS AND 2 WARNINGS AFFECTING 8 LINES
--------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found
     |         |     "\r\n"
  26 | ERROR   | [ ] The array declaration extends to column 88 (the limit is
     |         |     80). The array content should be split up over multiple
     |         |     lines
  27 | ERROR   | [ ] The array declaration extends to column 86 (the limit is
     |         |     80). The array content should be split up over multiple
     |         |     lines
  28 | ERROR   | [ ] The array declaration extends to column 93 (the limit is
     |         |     80). The array content should be split up over multiple
     |         |     lines
  29 | ERROR   | [ ] The array declaration extends to column 96 (the limit is
     |         |     80). The array content should be split up over multiple
     |         |     lines
  54 | WARNING | [ ] Only string literals should be passed to t() where
     |         |     possible
 100 | WARNING | [ ] Only string literals should be passed to t() where
     |         |     possible
 157 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 475ms; Memory: 10MB

Proposed resolution

Fix the errors and warnings.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India Jay Jangid

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

Comments & Activities

Production build 0.71.5 2024