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
Issue fork queue_unique-3372937
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
Comment #3
sidharth_soman commentedI've fixed all the issues except for the README file. Leaving it as it is for readability.
Please review the MR
Comment #5
ashutosh ahirwal commentedHi I have updated the MR need review.
Comment #6
cleavinjosh commentedHi @Ashutosh Ahirwal,
I applied MR!3, it was applied smoothly and fixed the phpcs issues.
Thank you.