Fix the issues reported by phpcs

Created on 11 July 2023, 12 months ago
Updated 12 July 2023, 12 months ago

Problem/Motivation

C:\xampp\htdocs\backendassignment\web\modules\contrib>phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig field_ui_modern

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\field_ui_modern\react\README.md
-------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------
 25 | WARNING | Line exceeds 80 characters; contains 95 characters
 36 | WARNING | Line exceeds 80 characters; contains 171 characters
 38 | WARNING | Line exceeds 80 characters; contains 322 characters
 40 | WARNING | Line exceeds 80 characters; contains 271 characters
-------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\field_ui_modern\react\src\App.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:\xampp\htdocs\backendassignment\web\modules\contrib\field_ui_modern\react\src\index.css
-----------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
  4 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  5 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
  5 | ERROR | [ ] No style definition found on line; check for missing colon
 12 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 12 | ERROR | [ ] No style definition found on line; check for missing colon
-----------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\field_ui_modern\README.txt
--------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------
 4 | WARNING | Line exceeds 80 characters; contains 85 characters
--------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\field_ui_modern\src\Controller\Fields.php
-----------------------------------------------------------------------------------------------------
FOUND 24 ERRORS AND 8 WARNINGS AFFECTING 25 LINES
-----------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  9 | ERROR   | [x] Missing class doc comment
 10 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
 10 | ERROR   | [x] Missing function doc comment
 10 | ERROR   | [x] Expected 1 blank line before function; 0 found
 11 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
 11 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 12 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
 12 | ERROR   | [x] Expected 1 space after "="; 2 found
 13 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
 13 | ERROR   | [x] Expected 1 space after FOREACH keyword; 0 found
 13 | ERROR   | [x] There should be no white space after an opening "("
 14 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 5
 15 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 5
 16 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 5
 17 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
 18 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
 19 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
 19 | ERROR   | [x] Expected 1 blank line after function; 0 found
 20 | ERROR   | [x] Missing function doc comment
 21 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 25 | ERROR   | [x] Missing function doc comment
 26 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 30 | ERROR   | [x] Missing function doc comment
 31 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
 32 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
 35 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 36 | ERROR   | [x] Expected 1 space after "="; 2 found
 37 | ERROR   | [x] Expected 1 space after FOREACH keyword; 0 found
 42 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
 46 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 47 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
-----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 24 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\field_ui_modern\src\Controller\FieldUi.php
------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 1 WARNING AFFECTING 7 LINES
------------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  7 | ERROR   | [x] Missing class doc comment
  7 | ERROR   | [x] Expected 1 space before opening brace; found 0
  9 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
  9 | ERROR   | [x] Missing function doc comment
 10 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 3
 18 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 20 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 1
 20 | ERROR   | [x] Expected 1 blank line after function; 0 found
 21 | ERROR   | [x] The closing brace for the class must have an empty line before it
------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------

Time: 996ms; Memory: 6MB

Steps to reproduce

Run the phpcs command on the module.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Closed: works as designed

Component

Code

Created by

🇮🇳India sidharth_soman Bangalore

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024