Fix the issues reported by phpcs

Created on 18 April 2023, almost 2 years ago
Updated 20 April 2023, almost 2 years ago

Problem/Motivation

FILE: /webform_shs/src/Plugin/WebformElement/ShsTermSelect.php
-----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
 126 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-----------------------------------------------------------------------------------------------------------


FILE: /webform_shs/src/Element/ShsTermSelect.php
---------------------------------------------------------------------------------------------
FOUND 20 ERRORS AND 3 WARNINGS AFFECTING 20 LINES
---------------------------------------------------------------------------------------------
   5 | WARNING | [x] Unused use statement
   6 | WARNING | [x] Unused use statement
  10 | WARNING | [x] Unused use statement
  31 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
  32 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
  33 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
  34 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
  35 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
  36 | ERROR   | [x] Array indentation error, expected 6 spaces but found 8
  37 | ERROR   | [x] Array closing indentation error, expected 4 spaces but found 6
 116 | ERROR   | [x] Data types in @param tags need to be fully namespaced
 119 | ERROR   | [x] Expected 1 space before opening brace; found 0
 157 | ERROR   | [x] Missing function doc comment
 179 | ERROR   | [ ] @throws comment must be on the next line
 179 | ERROR   | [x] Data types in @throws tags need to be fully namespaced
 221 | ERROR   | [x] Data types in @throws tags need to be fully namespaced
 222 | ERROR   | [x] Data types in @throws tags need to be fully namespaced
 244 | ERROR   | [ ] @throws comment must be on the next line
 244 | ERROR   | [x] Data types in @throws tags need to be fully namespaced
 247 | ERROR   | [x] Opening brace should be on the same line as the declaration
 270 | ERROR   | [ ] @throws comment must be on the next line
 270 | ERROR   | [x] Data types in @throws tags need to be fully namespaced
 275 | ERROR   | [x] Data types in @var tags need to be fully namespaced
---------------------------------------------------------------------------------------------


FILE: /webform_shs/webform_shs.module
----------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------------------
 12 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 1
 13 | ERROR | [x] Expected 2 space(s) before asterisk; 1 found
 14 | ERROR | [x] Expected 2 space(s) before asterisk; 1 found
----------------------------------------------------------------------------------

Steps to reproduce

phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml webform_shs

Proposed resolution

Fix the errors and warnings.

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇳India Binoli Lalani Gujarat

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

Comments & Activities

  • Issue created by @Binoli Lalani
  • @binoli-lalani opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • 🇮🇳India Binoli Lalani Gujarat

    Hello,

    I fixed PHPCS errors and warnings. Please review MR.

    Thank you!

  • Status changed to Needs work almost 2 years ago
  • 🇵🇭Philippines clarkssquared

    Hi Binoli Lalani,

    I applied your MR !3 in my local with Drupal 9.5.7 to "Webform Simple Hierarchical Select" module against version 2.0.0-beta1, I confirmed that the mentioned phpcs error was fixed however there are new phpcs warning being flagged.

    Please look at the screenshot attached for your reference.

    Thank you

  • Status changed to Needs review almost 2 years ago
  • 🇮🇳India Binoli Lalani Gujarat

    Hello @clarkssquared,

    Thank you for testing the code and verifying it.
    Actually, when we clone the module, it is not showing the warnings which are showing in "3354803-after.png".
    I think "project", "datestamp" and "version" have been automatically added when we installing module by composer.

    I think we are goog with the current code.

    Please share your view on this.

    Thank you!

  • Status changed to RTBC almost 2 years ago
  • 🇵🇭Philippines clarkssquared

    Hi @Binoli Lalani,

    Thank you for the information, moving this to RTBC.

    Thank you

  • Status changed to Fixed almost 2 years ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024