Drupal Coding Standards Issues | phpcs

Created on 2 February 2023, over 1 year ago
Updated 4 April 2024, 3 months ago

Problem/Motivation

FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/doi_field/doi_field.module
---------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 2 WARNINGS AFFECTING 7 LINES
---------------------------------------------------------------------------------------------------
  8 | ERROR   | [x] Line indented incorrectly; expected 0 spaces, found 1
  9 | ERROR   | [x] Expected 2 space(s) before asterisk; 1 found
 10 | ERROR   | [x] Expected 2 space(s) before asterisk; 1 found
 16 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 20 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 21 | WARNING | [x] A comma should follow the last multiline array item. Found: false
 21 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 24 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
---------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/doi_field/README.txt
---------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
 42 | ERROR | [x] Expected 1 newline at end of file; 2 found
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/doi_field/doi_field.info.yml
-----------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------
 7 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
-----------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/doi_field/src/Plugin/Field/FieldWidget/DoiFieldWidget.php
----------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------
 23 | WARNING | [ ] Possible useless method overriding detected
 34 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x/drupal/modules/contrib/doi_field/src/Plugin/Field/FieldFormatter/DoiFieldFormatter.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 71 ERRORS AND 4 WARNINGS AFFECTING 65 LINES
----------------------------------------------------------------------------------------------------------------------------------------
  23 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 3
  24 | ERROR   | [x] Expected 4 space(s) before asterisk; 3 found
  25 | ERROR   | [x] Expected 4 space(s) before asterisk; 3 found
  28 | ERROR   | [x] Expected one space after the comma, 0 found
  65 | ERROR   | [x] Expected 1 space after "="; 2 found
  75 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
  76 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
  80 | ERROR   | [x] Expected one space after the comma, 0 found
  90 | WARNING | [ ] Unused variable $delta.
  93 | WARNING | [x] A comma should follow the last multiline array item. Found: )
  99 | ERROR   | [x] Expected 1 space after "=>"; 2 found
 103 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 107 | ERROR   | [x] Whitespace found at end of line
 109 | ERROR   | [x] Doc comment short description must end with a full stop
 110 | ERROR   | [x] Whitespace found at end of line
 111 | ERROR   | [ ] Missing parameter comment
 111 | ERROR   | [ ] Missing parameter name
 112 | ERROR   | [x] Whitespace found at end of line
 113 | ERROR   | [ ] Description for the @return value must be on the next line
 115 | ERROR   | [x] Expected 1 space before opening brace; found 0
 116 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 120 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
 124 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 127 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 129 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
 130 | ERROR   | [x] Expected 1 space after "="; 2 found
 132 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 135 | ERROR   | [x] Expected one space after the comma, 0 found
 137 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 140 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 143 | ERROR   | [x] Case breaking statements must be followed by a single blank line
 152 | ERROR   | [x] Doc comment short description must end with a full stop
 153 | ERROR   | [x] Whitespace found at end of line
 154 | ERROR   | [ ] Missing parameter comment
 154 | ERROR   | [ ] Missing parameter name
 155 | ERROR   | [x] Whitespace found at end of line
 156 | ERROR   | [ ] Description for the @return value must be on the next line
 158 | ERROR   | [x] Expected 1 space before opening brace; found 0
 160 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
 161 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
 161 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 161 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 161 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
 162 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 7
 163 | ERROR   | [x] Line indented incorrectly; expected 8 spaces, found 7
 170 | ERROR   | [x] Doc comment short description must end with a full stop
 171 | ERROR   | [x] Whitespace found at end of line
 172 | ERROR   | [ ] Missing parameter comment
 172 | ERROR   | [ ] Missing parameter name
 173 | ERROR   | [x] Whitespace found at end of line
 174 | ERROR   | [ ] Description for the @return value must be on the next line
 176 | ERROR   | [x] Expected 1 space before opening brace; found 0
 177 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
 178 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
 179 | ERROR   | [x] Expected 1 space after IF keyword; 0 found
 179 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
 182 | ERROR   | [x] Whitespace found at end of line
 185 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 189 | ERROR   | [x] Doc comment short description must end with a full stop
 190 | ERROR   | [x] Whitespace found at end of line
 191 | ERROR   | [ ] Missing parameter comment
 191 | ERROR   | [ ] Missing parameter name
 192 | ERROR   | [x] Whitespace found at end of line
 193 | ERROR   | [ ] Description for the @return value must be on the next line
 195 | ERROR   | [x] Expected one space after the comma, 0 found
 195 | ERROR   | [x] Expected 1 space before opening brace; found 0
 197 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
 198 | ERROR   | [x] Concat operator must be surrounded by a single space
 199 | ERROR   | [x] Expected 1 space after closing parenthesis; found 0
 200 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 202 | ERROR   | [x] Expected 1 space after "="; 2 found
 202 | ERROR   | [x] Concat operator must be surrounded by a single space
 204 | ERROR   | [x] Expected one space after the comma, 0 found
 205 | ERROR   | [x] Expected 1 blank line after function; 0 found
 206 | ERROR   | [x] The closing brace for the class must have an empty line before it
----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 61 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run the following command : phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml /10.1.x/drupal/modules/contrib/doi_field

Proposed resolution

Fix all the PHP coding standard issues.

Remaining tasks

  • Some Issues are left to fix

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia sahil.goyal

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

Merge Requests

Comments & Activities

Production build 0.69.0 2024