Fix the issue reported by phpcs

Created on 18 July 2023, over 1 year ago
Updated 31 July 2023, over 1 year ago

Problem/Motivation

Getting following error/warnings:

FILE: D:\xampp\htdocs\project_10\web\modules\contrib\daterangepickerwidget\src\DateRangePickerHelper.php
--------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 1 WARNING AFFECTING 10 LINES
--------------------------------------------------------------------------------------------------------
13 | ERROR | Description for the @return value is missing
16 | ERROR | Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead
33 | ERROR | Description for the @return value is missing
52 | ERROR | Missing parameter comment
53 | ERROR | Missing parameter comment
94 | ERROR | Doc comment is empty
109 | WARNING | Line exceeds 80 characters; contains 90 characters
111 | ERROR | Missing parameter comment
112 | ERROR | Missing parameter comment
121 | ERROR | Doc comment is empty
--------------------------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\project_10\web\modules\contrib\daterangepickerwidget\src\Element\DateRangePickerElement.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 3 WARNINGS AFFECTING 7 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
11 | WARNING | Line exceeds 80 characters; contains 89 characters
40 | ERROR | Doc comment is empty
50 | WARNING | Line exceeds 80 characters; contains 107 characters
71 | ERROR | The array declaration extends to column 125 (the limit is 80). The array content should be split up over multiple lines
75 | WARNING | Line exceeds 80 characters; contains 110 characters
82 | ERROR | Doc comment is empty
106 | ERROR | Doc comment is empty
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\project_10\web\modules\contrib\daterangepickerwidget\src\Plugin\better_exposed_filters\filter\DateRangePickerFilter.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
25 | ERROR | The array declaration extends to column 179 (the limit is 80). The array content should be split up over multiple lines
42 | WARNING | Unused variable $element.
69 | WARNING | Line exceeds 80 characters; contains 113 characters
116 | ERROR | Doc comment is empty
---------------------------------------------------------------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\project_10\web\modules\contrib\daterangepickerwidget\src\Plugin\Field\FieldFormatter\DateRangePickerDefaultFormatter.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------------------
12 | WARNING | Line exceeds 80 characters; contains 81 characters
24 | ERROR | Doc comment is empty
----------------------------------------------------------------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\project_10\web\modules\contrib\daterangepickerwidget\src\Plugin\Field\FieldWidget\DateRangePickerDefaultWidget.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 5 WARNINGS AFFECTING 8 LINES
----------------------------------------------------------------------------------------------------------------------------------------
51 | WARNING | Line exceeds 80 characters; contains 81 characters
53 | WARNING | Line exceeds 80 characters; contains 100 characters
66 | ERROR | Comment indentation error, expected only 1 spaces
67 | WARNING | Line exceeds 80 characters; contains 98 characters
67 | ERROR | Comment indentation error, expected only 9 spaces
99 | ERROR | Comment indentation error, expected only 1 spaces
101 | WARNING | Line exceeds 80 characters; contains 141 characters
102 | WARNING | There must be no blank line following an inline comment
102 | ERROR | Comment indentation error, expected only 5 spaces
105 | ERROR | Doc comment short description must start with a capital letter
105 | ERROR | Doc comment short description must end with a full stop
----------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run following command:

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

Proposed resolution

Above error/warnings need to be fixed

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India arti_parmar

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

Comments & Activities

  • Issue created by @arti_parmar
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India arti_parmar

    Kindly review patch.

  • Status changed to Needs work over 1 year ago
  • 🇵🇭Philippines clarkssquared

    Hi arti_parmar

    I applied your patch #2 and reviewed it, and after applying an error stated below remains.

    FILE: /Users/studenttrainees/daterangepickerwidget/src/Plugin/Field/FieldWidget/DateRangePickerDefaultWidget.php
    ----------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------
    23 | ERROR | [x] Additional blank lines found at end of doc comment
    ----------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------

    Time: 478ms; Memory: 10MB

    please look at the screenshot I attached for your reference.

    Thank you

  • First commit to issue fork.
  • @joshua1234511 opened merge request.
  • First commit to issue fork.
  • Status changed to Fixed over 1 year ago
  • 🇮🇳India josedsilva Goa

    Issue fixed and added to dev and will become available in the next release.

  • Assigned to josedsilva
  • Status changed to Fixed over 1 year ago
  • 🇮🇳India josedsilva Goa

    Fixed issues reported by phpcs

Production build 0.71.5 2024