Fix the errors/warnings reported by Php_CodeSniffer

Created on 6 July 2023, over 1 year ago
Updated 10 July 2024, 5 months ago

Problem/Motivation

PHPCS gives the following errors:

C:\xampp\htdocs\backendassignment\web\modules\contrib>phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig queue_unique

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\queue_unique\queue_unique.install
---------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
 1 | ERROR | [x] Missing file doc comment
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\queue_unique\README.md
----------------------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------------------
  2 | WARNING | Line exceeds 80 characters; contains 173 characters
 25 | WARNING | Line exceeds 80 characters; contains 85 characters
 35 | WARNING | Line exceeds 80 characters; contains 85 characters
 48 | WARNING | Line exceeds 80 characters; contains 98 characters
 50 | WARNING | Line exceeds 80 characters; contains 92 characters
 63 | WARNING | Line exceeds 80 characters; contains 105 characters
 86 | WARNING | Line exceeds 80 characters; contains 84 characters
----------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\queue_unique\src\Plugin\QueueUI\UniqueDatabaseQueue.php
-------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
 17 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
 17 | ERROR | [ ] Namespaced classes/interfaces/traits should be referenced with use statements
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\queue_unique\src\QueueFactory.php
---------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\queue_unique\src\UniqueDatabaseQueue.php
----------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\queue_unique\src\UniqueQueueDatabaseFactory.php
-----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\queue_unique\tests\src\Kernel\QueueFactoryTest.php
--------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 6 WARNINGS AFFECTING 12 LINES
--------------------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  55 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
  62 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
  68 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
  75 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
  81 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
  90 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
 128 | ERROR   | [ ] Missing parameter type
 130 | ERROR   | [ ] Missing parameter type
 157 | ERROR   | [x] Return comment indentation must be 3 spaces, found 2 spaces
 179 | ERROR   | [x] Expected 1 blank line after function; 0 found
 180 | ERROR   | [x] The closing brace for the class must have an empty line before it
--------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\queue_unique\tests\src\Kernel\UniqueQueueTest.php
-------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 2 WARNINGS AFFECTING 5 LINES
-------------------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  36 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
 132 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
 155 | ERROR   | [ ] Missing parameter type
 158 | ERROR   | [ ] Return type missing for @return tag in function comment
-------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------

Time: 1.4 secs; Memory: 6MB

Steps to reproduce

Run the phpcs command on the module.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ“Œ Task
Status

RTBC

Version

3.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia sidharth_soman Bangalore

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024