Fix the issues reported by phpcs

Created on 7 July 2023, over 1 year ago
Updated 2 February 2024, 10 months ago

Problem/Motivation

Phpcs gives the following errors:

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 emulsify_twig

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\emulsify_twig\emulsify_twig.info.yml
-----------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
 1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-----------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\emulsify_twig\README.md
-----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 11 WARNINGS AFFECTING 11 LINES
-----------------------------------------------------------------------------------
  11 | WARNING | Line exceeds 80 characters; contains 107 characters
  47 | WARNING | Line exceeds 80 characters; contains 83 characters
  51 | WARNING | Line exceeds 80 characters; contains 86 characters
  63 | WARNING | Line exceeds 80 characters; contains 119 characters
 103 | WARNING | Line exceeds 80 characters; contains 88 characters
 105 | WARNING | Line exceeds 80 characters; contains 126 characters
 114 | WARNING | Line exceeds 80 characters; contains 99 characters
 120 | WARNING | Line exceeds 80 characters; contains 113 characters
 128 | WARNING | Line exceeds 80 characters; contains 106 characters
 131 | WARNING | Line exceeds 80 characters; contains 117 characters
 132 | WARNING | Line exceeds 80 characters; contains 148 characters
-----------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\emulsify_twig\src\AddAttributesTwigExtension.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 17 ERRORS AFFECTING 12 LINES
------------------------------------------------------------------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
  3 | ERROR | [x] There must be one blank line after the namespace declaration
  7 | ERROR | [x] Doc comment short description must end with a full stop
 13 | ERROR | [ ] Doc comment short description must start with a capital letter
 14 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
 16 | ERROR | [x] Expected 1 blank line before function; 0 found
 24 | ERROR | [x] Short array syntax must be used to define arrays
 25 | ERROR | [x] Short array syntax must be used to define arrays
 25 | ERROR | [ ] The array declaration extends to column 139 (the limit is 80). The array content should be split up over multiple lines
 25 | ERROR | [x] Short array syntax must be used to define arrays
 25 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
 25 | ERROR | [x] Short array syntax must be used to define arrays
 33 | ERROR | [x] You must use "/**" style comments for a function comment
 33 | ERROR | [ ] Public method name "AddAttributesTwigExtension::add_attributes" is not in lowerCamel format
 84 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
 92 | ERROR | [x] Expected 1 blank line after function; 0 found
 93 | ERROR | [x] The closing brace for the class must have an empty line before it
------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\emulsify_twig\src\BemTwigExtension.php
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 18 ERRORS AFFECTING 12 LINES
-------------------------------------------------------------------------------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
   3 | ERROR | [x] There must be one blank line after the namespace declaration
   7 | ERROR | [x] Doc comment short description must end with a full stop
  13 | ERROR | [ ] Doc comment short description must start with a capital letter
  14 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
  16 | ERROR | [x] Expected 1 blank line before function; 0 found
  24 | ERROR | [x] Short array syntax must be used to define arrays
  25 | ERROR | [x] Short array syntax must be used to define arrays
  25 | ERROR | [ ] The array declaration extends to column 117 (the limit is 80). The array content should be split up over multiple lines
  25 | ERROR | [x] Short array syntax must be used to define arrays
  25 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
  25 | ERROR | [x] Short array syntax must be used to define arrays
  32 | ERROR | [x] You must use "/**" style comments for a function comment
  32 | ERROR | [x] Short array syntax must be used to define arrays
  32 | ERROR | [x] Short array syntax must be used to define arrays
  98 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
 121 | ERROR | [x] Expected 1 blank line after function; 0 found
 122 | ERROR | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 15 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------

Time: 792ms; 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

Fixed

Version

4.0

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