Drupal Coding Standards Issues | phpcs

Created on 3 February 2023, almost 2 years ago

Problem/Motivation

C:\xampp\htdocs\abc\drupal\modules>phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml date_filter

FILE: ...:\xampp\htdocs\abc\drupal\modules\date_filter\date_filter.module
----------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n"
| | but found "\r\n"
13 | WARNING | [ ] Format should be "* Implements hook_foo().", "*
| | Implements hook_foo_BAR_ID_bar() for
| | xyz_bar().",, "* Implements hook_foo_BAR_ID_bar()
| | for xyz-bar.html.twig.", "* Implements
| | hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or
| | "* Implements hook_foo_BAR_ID_bar() for block
| | templates."
13 | ERROR | [ ] Doc comment short description must end with a
| | full stop
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...\abc\drupal\modules\date_filter\src\Plugin\views\filter\Date.php
----------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n"
| | but found "\r\n"
240 | WARNING | [ ] Unused variable $element.
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

FILE: ...c\drupal\modules\date_filter\tests\src\Kernel\DateFilterTest.php
----------------------------------------------------------------------
FOUND 4 ERRORS AND 3 WARNINGS AFFECTING 6 LINES
----------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n"
| | but found "\r\n"
56 | ERROR | [ ] Missing member variable doc comment
57 | ERROR | [ ] Missing member variable doc comment
138 | ERROR | [x] Functions must not contain multiple empty lines
| | in a row; found 2 empty lines
216 | WARNING | [ ] Unused variable $execute_time.
219 | WARNING | [x] There must be no blank line following an inline
| | comment
219 | WARNING | [ ] There must be no blank line following an inline
| | comment
----------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

Time: 755ms; Memory: 12MB

Steps to reproduce

Run the following command : phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml /10.1.x/drupal/modules/contrib/date_filter

Proposed resolution

Fix all the PHP coding standard issues.

📌 Task
Status

Fixed

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

Comments & Activities

Production build 0.71.5 2024