Fix the issues reported by phpcs

Created on 9 March 2023, over 1 year ago
Updated 11 November 2023, 8 months ago

Problem/Motivation

FILE: /Users/sahil.goyal/Documents/MySites/10.1.x-new/drupal1/modules/contrib/entityreference_dragdrop/entityreference_dragdrop.module
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------------------------
  1 | ERROR | [x] Missing file doc comment
 25 | ERROR | [ ] Missing parameter comment
 27 | ERROR | [ ] Type hint "array" missing for $variables
--------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/sahil.goyal/Documents/MySites/10.1.x-new/drupal1/modules/contrib/entityreference_dragdrop/README.txt
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
 1 | ERROR | File contains UTF-8 byte order mark, which may corrupt your application
-----------------------------------------------------------------------------------------------------------------


FILE: ....goyal/Documents/MySites/10.1.x-new/drupal1/modules/contrib/entityreference_dragdrop/src/Plugin/Field/FieldWidget/EntityReferenceDragDropWidget.php
---------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 38 ERRORS AND 4 WARNINGS AFFECTING 32 LINES
---------------------------------------------------------------------------------------------------------------------------------------------------------
  13 | ERROR   | [x] There must be one blank line after the last USE statement; 2 found;
  31 | WARNING | [ ] There must be no blank line following an inline comment
  31 | ERROR   | [x] Comments may not appear after statements
  33 | ERROR   | [ ] Missing short description in doc comment
  38 | ERROR   | [ ] Missing short description in doc comment
  46 | ERROR   | [ ] Missing parameter comment
  47 | ERROR   | [ ] Missing parameter comment
  48 | ERROR   | [ ] Missing parameter comment
  49 | ERROR   | [ ] Missing parameter comment
  50 | ERROR   | [ ] Missing parameter comment
  51 | ERROR   | [ ] Missing parameter comment
  52 | ERROR   | [ ] Missing parameter comment
 102 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 109 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 143 | ERROR   | [x] Concat operator must be surrounded by a single space
 153 | WARNING | [x] A comma should follow the last multiline array item. Found: 'just some value so #required does not trigger validation error.'
 158 | ERROR   | [x] Array indentation error, expected 8 spaces but found 10
 221 | ERROR   | [ ] Missing parameter comment
 222 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 222 | ERROR   | [ ] Description for the @return value is missing
 242 | ERROR   | [ ] Missing parameter comment
 243 | ERROR   | [ ] Missing parameter comment
 243 | ERROR   | [ ] Missing parameter type
 244 | ERROR   | [ ] Missing parameter comment
 244 | ERROR   | [ ] Missing parameter type
 245 | ERROR   | [ ] Missing parameter comment
 246 | ERROR   | [ ] Missing parameter comment
 247 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 247 | ERROR   | [ ] Description for the @return value is missing
 250 | ERROR   | [x] Inline comments must start with a capital letter
 250 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
 300 | ERROR   | [ ] Missing parameter comment
 301 | ERROR   | [ ] Missing parameter comment
 301 | ERROR   | [ ] Missing parameter type
 302 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 302 | ERROR   | [ ] Description for the @return value is missing
 311 | ERROR   | [ ] Missing parameter comment
 312 | ERROR   | [ ] Missing parameter comment
 312 | ERROR   | [ ] Missing parameter type
 313 | ERROR   | [x] Separate the @param and @return sections by a blank line.
 313 | ERROR   | [ ] Description for the @return value is missing
 322 | ERROR   | [ ] Description for the @return value is missing
---------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 114ms; Memory: 10MB

Steps to reproduce

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

Proposed resolution

Fix all the phpcs issues and warnings

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
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

Comments & Activities

Production build 0.69.0 2024