Drupal Coding Standards Issues | phpcs

Created on 1 February 2023, almost 2 years ago
Updated 8 July 2024, 6 months ago

Problem/Motivation

Getting following error/warnings.

FILE: C:\xampp\htdocs\abc\drupal\modules\nameday_skhu\README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
18 | WARNING | Line exceeds 80 characters; contains 129 characters
----------------------------------------------------------------------

FILE: ...ampp\htdocs\abc\drupal\modules\nameday_skhu\src\NamedayClass.php
----------------------------------------------------------------------
FOUND 10 ERRORS AFFECTING 7 LINES
----------------------------------------------------------------------
10 | ERROR | Missing short description in doc comment
11 | ERROR | Missing parameter comment
12 | ERROR | Missing parameter comment
12 | ERROR | Missing parameter type
13 | ERROR | Missing parameter comment
13 | ERROR | Missing parameter type
14 | ERROR | Missing parameter comment
14 | ERROR | Missing parameter type
15 | ERROR | Description for the @return value is missing
211 | ERROR | Doc comment is empty
----------------------------------------------------------------------

FILE: ...\drupal\modules\nameday_skhu\src\Plugin\Block\NamedayBlockHu.php
----------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 8 LINES
----------------------------------------------------------------------
20 | ERROR | Missing short description in doc comment
25 | ERROR | Missing short description in doc comment
26 | ERROR | Missing parameter comment
26 | ERROR | Missing parameter name
33 | ERROR | Missing short description in doc comment
34 | ERROR | Missing parameter comment
35 | ERROR | Missing parameter comment
36 | ERROR | Missing parameter comment
37 | ERROR | Missing parameter comment
----------------------------------------------------------------------

FILE: ...\drupal\modules\nameday_skhu\src\Plugin\Block\NamedayBlockSk.php
----------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 8 LINES
----------------------------------------------------------------------
20 | ERROR | Missing short description in doc comment
25 | ERROR | Missing short description in doc comment
26 | ERROR | Missing parameter comment
26 | ERROR | Missing parameter name
33 | ERROR | Missing short description in doc comment
34 | ERROR | Missing parameter comment
35 | ERROR | Missing parameter comment
36 | ERROR | Missing parameter comment
37 | ERROR | Missing parameter comment
----------------------------------------------------------------------

Steps to reproduce

Run following command

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

Proposed resolution

Above error/warnings need to be fixed.

๐Ÿ› Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia Charchil Khandelwal

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

Merge Requests

Comments & Activities

  • Issue created by @Charchil Khandelwal
  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Charchil Khandelwal

    Some errors and warnings are fixed now.
    Created MR !3 for same, please review.

    Thank You.

  • Assigned to gaurav-mathur
  • Status changed to Needs work almost 2 years ago
  • FILE: ...\drupal\modules\nameday_skhu\src\Plugin\Block\NamedayBlockHu.php
    ----------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    ----------------------------------------------------------------------
    32 | ERROR | Missing parameter type
    34 | ERROR | Missing parameter type
    36 | ERROR | Missing parameter type
    ----------------------------------------------------------------------

    FILE: ...\drupal\modules\nameday_skhu\src\Plugin\Block\NamedayBlockSk.php
    ----------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    ----------------------------------------------------------------------
    32 | ERROR | Missing parameter type
    34 | ERROR | Missing parameter type
    36 | ERROR | Missing parameter type
    ----------------------------------------------------------------------

    Need to fix these errors.

  • Issue was unassigned.
  • bindu r โ†’ made their first commit to this issueโ€™s fork.

  • Assigned to nitin_lama
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India

    Re-based and fixed conflicts in the MR.
    Please review. Thanks.

  • Issue was unassigned.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nitin_lama India
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia riddhi.addweb

    I have applied the latest patch but still, there are some errors.
    Please check the screenshot for the same.

    FILE: /var/www/html/web/drupal10/web/modules/contrib/nameday_skhu/src/Plugin/Block/NamedayBlockHu.php
    ---------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    ---------------------------------------------------------------------------------------------------------------------------------------------
    8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Plugin\ContainerFactoryPluginInterface.
    78 | ERROR | [x] @inheritDoc found. Did you mean {@inheritDoc}?
    ---------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/web/drupal10/web/modules/contrib/nameday_skhu/src/Plugin/Block/NamedayBlockSk.php
    ---------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    ---------------------------------------------------------------------------------------------------------------------------------------------
    8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Plugin\ContainerFactoryPluginInterface.
    78 | ERROR | [x] @inheritDoc found. Did you mean {@inheritDoc}?
    ---------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------------------------------------

  • Status changed to Needs work 6 months ago
Production build 0.71.5 2024