Fix the issues reported by phpcs

Created on 21 July 2023, over 1 year ago

Problem/Motivation

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



FILE: /modules/contrib/profitroom/src/Plugin/Field/FieldFormatter/ProfitroomFormatter.php
-------------------------------------------------------------------------------------------------
FOUND 25 ERRORS AND 2 WARNINGS AFFECTING 25 LINES
-------------------------------------------------------------------------------------------------
  6 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Field\FieldItemListInterface.
 20 | ERROR   | [x] Whitespace found at end of line
 21 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 24 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 25 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 26 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 27 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 28 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 29 | ERROR   | [x] Whitespace found at end of line
 30 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 33 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 34 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 35 | ERROR   | [x] Whitespace found at end of line
 36 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 37 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 38 | ERROR   | [x] Whitespace found at end of line
 38 | ERROR   | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 39 | ERROR   | [x] Whitespace found at end of line
 40 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 41 | ERROR   | [x] Line indented incorrectly; expected 6 spaces, found 12
 44 | WARNING | [x] A comma should follow the last multiline array item. Found: $hotel_name
 46 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 47 | ERROR   | [x] Whitespace found at end of line
 48 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 49 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 50 | ERROR   | [x] Whitespace found at end of line
-------------------------------------------------------------------------------------

FILE: /modules/contrib/profitroom/src/Plugin/Block/ProfitroomBlock.php
------------------------------------------------------------------------------------
FOUND 11 ERRORS AND 2 WARNINGS AFFECTING 12 LINES
-------------------------------------------------------------------------------------
 17 | ERROR   | [x] Whitespace found at end of line
 18 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 21 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 22 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 23 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 24 | ERROR   | [x] Whitespace found at end of line
 25 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 27 | WARNING | [x] A comma should follow the last multiline array item. Found: $site_name
 29 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 30 | ERROR   | [x] Whitespace found at end of line
 31 | ERROR   | [x] Expected 1 newline at end of file; 2 found
 32 | ERROR   | [x] Whitespace found at end of line
-------------------------------------------------------------------------------


FILE: /modules/contrib/profitroom/src/Form/ProfitroomSettingsForm.php
-----------------------------------------------------------------------------------
FOUND 49 ERRORS AND 1 WARNING AFFECTING 44 LINES
------------------------------------------------------------------------------------
  3 | ERROR   | [x] Namespaced classes, interfaces and traits should not begin with a file doc comment
 13 | ERROR   | [x] Missing class doc comment
 14 | ERROR   | [x] Whitespace found at end of line
 15 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 18 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 19 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 20 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 21 | ERROR   | [x] Whitespace found at end of line
 22 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 25 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 26 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 27 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 28 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 29 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 30 | ERROR   | [x] Whitespace found at end of line
 31 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 32 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 33 | ERROR   | [x] Array indentation error, expected 10 spaces but found 12
 34 | ERROR   | [x] Array indentation error, expected 10 spaces but found 12
 34 | ERROR   | [x] Whitespace found at end of line
 35 | ERROR   | [x] Array indentation error, expected 10 spaces but found 12
 36 | ERROR   | [x] Array indentation error, expected 10 spaces but found 12
 38 | ERROR   | [x] Whitespace found at end of line
 39 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 40 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 41 | ERROR   | [x] Whitespace found at end of line
 42 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 45 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 46 | ERROR   | [x] Whitespace found at end of line
 47 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 50 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 51 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 52 | ERROR   | [x] Whitespace found at end of line
 53 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 54 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 55 | ERROR   | [x] Whitespace found at end of line
 56 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 57 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 58 | ERROR   | [x] Whitespace found at end of line
 59 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 62 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 63 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 64 | ERROR   | [x] Array indentation error, expected 10 spaces but found 12
 66 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 66 | ERROR   | [x] Expected 1 blank line after function; 0 found
 66 | ERROR   | [x] Whitespace found at end of line
 67 | ERROR   | [x] The closing brace for the class must have an empty line before it
 67 | ERROR   | [ ] Closing class brace must be on a line by itself
 67 | ERROR   | [x] Whitespace found at end of line
--------------------------------------------------------------------------------

FILE: /modules/contrib/profitroom/profitroom.module
----------------------------------------------------------------------------------
FOUND 2 ERRORS AND 5 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------------------
  5 | ERROR   | [x] Doc comment short description must end with a full stop
  8 | WARNING | [x] Unused use statement
  9 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Routing\RouteMatchInterface.
 35 | WARNING | [x] A comma should follow the last multiline array item. Found: NULL
 40 | WARNING | [x] A comma should follow the last multiline array item. Found: NULL
 41 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 42 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
-------------------------------------------------------------------------------


FILE: /modules/contrib/profitroom/profitroom.links.task.yml
-------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 4 | ERROR | [x] Expected 1 newline at end of file; 2 found
---------------------------------------------------------------------------------

📌 Task
Status

Fixed

Component

Code

Created by

🇮🇳India swatichouhan012

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