Problem/Motivation
PHPCS reports 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 imce_copylink
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\imce_copylink\imce_copylink.css
-------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
2 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
2 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
-------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\imce_copylink\src\Plugin\ImcePlugin\Copylink.php
------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 1 WARNING AFFECTING 7 LINES
------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
5 | WARNING | [x] Unused use statement
16 | ERROR | [x] There must be exactly one newline after the class comment
18 | ERROR | [ ] Class name doesn't match filename; expected "class Copylink"
24 | ERROR | [x] Short array syntax must be used to define arrays
34 | ERROR | [x] Expected 1 blank line after function; 0 found
35 | ERROR | [x] The closing brace for the class must have an empty line before it
------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------
Time: 600ms; Memory: 6MB
Steps to reproduce
Run the phpcs command on the module.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
sidharth_soman commentedAll issues fixed except the mismatch of the class name with the filename for the plugin file Copylink.php. I'm leaving it as it is for now.
Comment #3
clarkssquared commentedHi sidharth_soman
I applied your patch #2 to my local and I noticed that there is still PHPCS error being flagged in my terminal, for convenience below is the error.
FILE: /Users/studenttrainees/imce_copylink/src/Plugin/ImcePlugin/Copylink.php
-----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------
16 | ERROR | Class name doesn't match filename; expected "class Copylink"
-----------------------------------------------------------------------------
Time: 177ms; Memory: 10MB
Please also look at the screenshot I attached,
Thank you.
Comment #4
soham sengupta commentedHi,
I have fixed the remaining phpcs error in this patch.
Comment #5
roberttabigue commentedHi,
I reviewed the changes and confirmed the Patch was applied cleanly to the IMCE Copy Link module against 8.x-1.x-dev on Drupal 9.5.10.
And all PHPCS errors have been fixed.
I ran this command:
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig imce_copylinkPlease see the attached file for reference.
I'm moving this now to RTBC.
Thank you!
Comment #6
jeroentCan you please make a merge request for those changes?
Comment #9
jeroentMerged to 8.x-1.x. Thanks!