Drupal Coding Standards Issues | phpcs

Created on 31 January 2023, almost 2 years ago
Updated 20 February 2023, almost 2 years ago

Problem/Motivation

Getting Following errors/warnings

$ phpcs --standard=Drupal term_reference_tree

FILE: ...\Users\Admin\Desktop\task\term_reference_tree\src\Element\CheckboxTree.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: ...rs\Admin\Desktop\task\term_reference_tree\src\Element\CheckboxTreeItem.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found
    |       |     "\r\n"
 18 | ERROR | [x] Short array syntax must be used to define arrays
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...s\Admin\Desktop\task\term_reference_tree\src\Element\CheckboxTreeLabel.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found
    |       |     "\r\n"
 18 | ERROR | [x] Short array syntax must be used to define arrays
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...s\Admin\Desktop\task\term_reference_tree\src\Element\CheckboxTreeLevel.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found
    |       |     "\r\n"
 18 | ERROR | [x] Short array syntax must be used to define arrays
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...\term_reference_tree\src\Plugin\Field\FieldFormatter\TermReferenceTree.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found
    |         |     "\r\n"
 26 | ERROR   | [x] Short array syntax must be used to define arrays
 37 | WARNING | [ ] Possible useless method overriding detected
 44 | WARNING | [ ] Possible useless method overriding detected
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...ask\term_reference_tree\src\Plugin\Field\FieldWidget\TermReferenceTree.php
--------------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 8 LINES
--------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found
    |       |     "\r\n"
 36 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
 37 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
 38 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
 39 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
 40 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
 41 | ERROR | [x] Array closing indentation error, expected 4 spaces but found
    |       |     6
 87 | ERROR | [x] Object operator not indented correctly; expected 6 spaces but
    |       |     found 8
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: C:\Users\Admin\Desktop\task\term_reference_tree\term_reference_tree.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\term_reference_tree\term_reference_tree.js
--------------------------------------------------------------------------------
FOUND 22 ERRORS AFFECTING 18 LINES
--------------------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n" but found
     |       |     "\r\n"
   1 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
   7 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
   9 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  21 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  26 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
  27 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  53 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  70 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  70 | ERROR | [x] Expected 1 space before opening brace; found 0
  89 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  89 | ERROR | [x] Expected 1 space before opening brace; found 0
 120 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 196 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
 197 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 197 | ERROR | [x] Expected 1 space before opening brace; found 0
 202 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
 203 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
 208 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
 209 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
 280 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 281 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 22 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 512ms; Memory: 10MB

Proposed resolution

Fix the errors and warnings.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India jay jangid Jaipur

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

Comments & Activities

Production build 0.71.5 2024