Problem/Motivation
PHPCS reports the errors as follows:
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\entity_abuse\src\Controller\EntityAbuseNoAccess.php
-----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
12 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name
51 | WARNING | [x] '@TODO: Add logging of $entity_type & $entity_id data for statistics?' should match the format '@todo Fix problem X here.'
-----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\entity_abuse\src\EntityAbuseReportLinkLazyBuilder.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
94 | ERROR | [ ] The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
-----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\entity_abuse\src\Form\EntityAbuseReportDeleteForm.php
-----------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
11 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Url.
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\entity_abuse\src\Form\EntityAbuseSettingsForm.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\ContentEntityTypeInterface.
---------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------
Steps to reproduce
Run the phpcs command on the module.
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig entity_abuse
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3373668-5.patch | 2.84 KB | sakthi_dev |
| #2 | 3373668-2.patch | 2.16 KB | sidharth_soman |
Comments
Comment #2
sidharth_soman commentedI've solved all the issues except for the array exceeding column 80 in EntityAbuseReportLinkLazyBuilder.php. I'm keeping it that way due to readability.
Please review the patch.
Comment #3
sidharth_soman commentedComment #4
clarkssquared commentedHi
I applied your patch #2 and it fixes most of the PHPCS issues that has been reported but there is one PHPCS error that my terminal flagged, for your reference this is the output from my terminal after I applied your patch
Comment #5
sakthi_dev commentedAddressed the comment #4. Please review.
Comment #6
clarkssquared commentedHi
I applied patch #5 and I confirmed that it fixes all the PHPCS issues
Comment #8
antonnavi