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

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sidharth_soman created an issue. See original summary.

sidharth_soman’s picture

Assigned: sidharth_soman » Unassigned
Status: Needs work » Needs review

I've fixed all the issues except for the README file. Leaving it as it is for readability.

Please review the MR

Ashutosh Ahirwal made their first commit to this issue’s fork.

ashutosh ahirwal’s picture

Hi I have updated the MR need review.

cleavinjosh’s picture

Status: Needs review » Reviewed & tested by the community

Hi @Ashutosh Ahirwal,

I applied MR!3, it was applied smoothly and fixed the phpcs issues.

➜  queue_unique git:(3.x) curl https://git.drupalcode.org/project/queue_unique/-/merge_requests/3.diff | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7857    0  7857    0     0  11776      0 --:--:-- --:--:-- --:--:-- 11761
patching file README.md
patching file queue_unique.install
patching file tests/src/Kernel/QueueFactoryTest.php
patching file tests/src/Kernel/UniqueQueueTest.php
➜  queue_unique git:(3.x) ✗ ..
➜  contrib git:(main) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml queue_unique
➜  contrib git:(main) ✗

Thank you.