Fix the issues reported by phpcs

Created on 13 May 2023, over 1 year ago
Updated 15 May 2023, over 1 year ago

Problem/Motivation

Module's code contains several Drupal Coding Standards issues. This task is created to fix them.

Steps to reproduce

Run the command:

phpcs --standard=Drupal
/web/modules/contrib/entity_update_diff_json/

Proposed resolution

Fix the following coding standards issues and upload the patch or create an MR with fixes.

FILE: \modules\contrib\entity_update_diff_json\src\Controller\EntityUpdateDiffJsonController.php
--------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
---------------------------------------------------------------------------------
 11 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
 14 | ERROR   | Missing short description in doc comment
 15 | ERROR   | Description for the @return value is missing
 53 | ERROR   | Doc comment is empty
--------------------------------------------------------------------------------


FILE: \modules\contrib\entity_update_diff_json\src\Form\EntityUpdateDiffJsonForm.php
---------------------------------------------------------------------------------
FOUND 27 ERRORS AFFECTING 24 LINES
---------------------------------------------------------------------------------
  1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
  2 | ERROR | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
 11 | ERROR | [x] Missing class doc comment
 15 | ERROR | [x] Expected 1 blank line before function; 0 found
 19 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 20 | ERROR | [x] Expected 5 space(s) before asterisk; 3 found
 21 | ERROR | [x] Expected 5 space(s) before asterisk; 3 found
 27 | ERROR | [x] Whitespace found at end of line
 28 | ERROR | [x] Missing function doc comment
 31 | ERROR | [x] Short array syntax must be used to define arrays
 31 | ERROR | [x] There must be no space between the "array" keyword and the opening parenthesis
 44 | ERROR | [x] Short array syntax must be used to define arrays
 52 | ERROR | [x] Missing function doc comment
 52 | ERROR | [x] Expected 1 space before opening brace; found 0
 55 | ERROR | [x] Whitespace found at end of line
 57 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
 58 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
 60 | ERROR | [x] Whitespace found at end of line
 62 | ERROR | [x] Expected 1 blank line after function; 2 found
 63 | ERROR | [x] Whitespace found at end of line
 64 | ERROR | [x] Whitespace found at end of line
 65 | ERROR | [x] Missing function doc comment
 66 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 67 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 68 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
 71 | ERROR | [x] Expected 1 newline at end of file; 0 found
---------------------------------------------------------------------------------
📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India Shanu Chouhan

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