Problem/Motivation
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\varnish_purge-3354158\modules\varnish_focal_point_purge\varnish_focal_point_purge.module
-------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 6 WARNINGS AFFECTING 9 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
13 | WARNING | [x] Unused use statement
71 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
71 | WARNING | [x] 'TODO: Consider are we not doing duplicated work related to varnish_image purge...' should match the format '@todo Fix problem X here.'
73 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
77 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
80 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
86 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
88 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
100 | WARNING | [x] 'TODO: Have the concurrency exposed as configuration somewhere.' should match the format '@todo Fix problem X here.'
-------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\varnish_purge-3354158\modules\varnish_image_purge\src\Form\VarnishImagePurgeConfiguration.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"
86 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
125 | WARNING | [ ] '@todo' 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\varnish_purge-3354158\modules\varnish_image_purge\varnish_image_purge.module
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AND 7 WARNINGS AFFECTING 13 LINES
------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
13 | WARNING | [x] Unused use statement
79 | WARNING | [x] 'TODO: Does this exist? It's not using the purgers in ANY way.' should match the format '@todo Fix problem X here.'
86 | ERROR | [x] Blank comments are not allowed
104 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
110 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
115 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
119 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
127 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
127 | WARNING | [ ] Unused variable $delta.
133 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
139 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
141 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
155 | WARNING | [x] 'TODO: Have the concurrency exposed as configuration somewhere.' should match the format '@todo Fix problem X here.'
------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\varnish_purge-3354158\modules\varnish_purge_tags\src\Plugin\Purge\TagsHeader\CacheTags.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\varnish_purge-3354158\modules\varnish_purge_tags\src\Tests\CacheTagsTest.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
14 | ERROR | [ ] Missing member variable doc comment
----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\varnish_purge-3354158\src\DebugCallGraphTrait.php
-------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
-------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
11 | ERROR | [x] Missing trait doc comment
27 | ERROR | [ ] Description for the @return value is missing
81 | ERROR | [ ] Description for the @return value is missing
103 | ERROR | [ ] Description for the @return value is missing
201 | ERROR | [x] Expected 1 blank line after function; 0 found
202 | ERROR | [x] The closing brace for the trait must have an empty line before it
-------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\varnish_purge-3354158\src\Entity\VarnishPurgerSettings.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 12 LINES
-----------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
87 | ERROR | [ ] Class property $request_method should use lowerCamel naming without underscores
101 | ERROR | [ ] The @var tag must be the first tag in a member variable comment
117 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
121 | ERROR | [ ] Class property $runtime_measurement should use lowerCamel naming without underscores
135 | ERROR | [ ] Class property $connect_timeout should use lowerCamel naming without underscores
139 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
143 | ERROR | [ ] Class property $cooldown_time should use lowerCamel naming without underscores
148 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
152 | ERROR | [ ] Class property $max_requests should use lowerCamel naming without underscores
162 | ERROR | [ ] The @var tag must be the first tag in a member variable comment
164 | ERROR | [ ] Class property $http_errors should use lowerCamel naming without underscores
-----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\varnish_purge-3354158\src\Form\VarnishBundledPurgerForm.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
15 | ERROR | [ ] The @var tag must be the first tag in a member variable comment
-----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\varnish_purge-3354158\src\Form\VarnishPurgerForm.php
----------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
15 | ERROR | [ ] The @var tag must be the first tag in a member variable comment
----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\varnish_purge-3354158\src\Form\VarnishPurgerFormBase.php
--------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 3 WARNINGS AFFECTING 9 LINES
--------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
27 | WARNING | [ ] '@todo' should match the format '@todo Fix problem X here.'
31 | ERROR | [ ] The @var tag must be the first tag in a member variable comment
33 | ERROR | [ ] Class property $request_methods should use lowerCamel naming without underscores
83 | ERROR | [ ] Public method name "VarnishPurgerFormBase::getFormID" is not in lowerCamel format
223 | ERROR | [x] Use null coalesce operator instead of ternary operator.
258 | ERROR | [ ] Description for the @return value is missing
364 | WARNING | [ ] '@todo' should match the format '@todo Fix problem X here.'
378 | WARNING | [ ] Unused variable $tokens.
--------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\varnish_purge-3354158\src\Plugin\Purge\DiagnosticCheck\ConfigurationCheck.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"
24 | ERROR | [ ] Missing short description in doc comment
30 | WARNING | [ ] Line exceeds 80 characters; contains 89 characters
78 | ERROR | [x] PHP keywords must be lowercase; expected "self" but found "SELF"
83 | ERROR | [x] PHP keywords must be lowercase; expected "self" but found "SELF"
87 | ERROR | [x] PHP keywords must be lowercase; expected "self" but found "SELF"
92 | ERROR | [x] PHP keywords must be lowercase; expected "self" but found "SELF"
-----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\varnish_purge-3354158\src\Plugin\Purge\Purger\VarnishBundledPurger.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\varnish_purge-3354158\src\Plugin\Purge\Purger\VarnishPurger.php
---------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
---------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
33 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
38 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
44 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
---------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\varnish_purge-3354158\src\Plugin\Purge\Purger\VarnishPurgerBase.php
-------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 5 LINES
-------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
17 | ERROR | [ ] Missing short description in doc comment
100 | ERROR | [ ] Type hint "array" missing for $token_data
136 | ERROR | [ ] Type hint "array" missing for $token_data
180 | ERROR | [ ] Type hint "array" missing for $token_data
-------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\varnish_purge-3354158\src\Plugin\Purge\Purger\ZeroConfigPurger.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 20 ERRORS AND 6 WARNINGS AFFECTING 26 LINES
------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
46 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
57 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
78 | ERROR | [x] Expected "int" but found "?int" for @var tag in member variable comment
137 | ERROR | [ ] Description for the @return value is missing
172 | ERROR | [ ] Type hint "\Closure" missing for $requests
180 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
189 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
211 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
249 | WARNING | [x] A comma should follow the last multiline array item. Found: 'invalidateEverything'
251 | ERROR | [x] Use null coalesce operator instead of ternary operator.
305 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
309 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
314 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
357 | ERROR | [ ] Missing parameter comment
372 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
375 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
387 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
410 | ERROR | [ ] Missing parameter comment
425 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
428 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
437 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
489 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
515 | ERROR | [ ] Description for the @return value is missing
524 | ERROR | [ ] Missing parameter comment
526 | ERROR | [ ] Description for the @return value is missing
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 16 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\varnish_purge-3354158\src\Tests\VarnishBundledPurgerFormTest.php
----------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
31 | ERROR | [ ] The @var tag must be the first tag in a member variable comment
----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\varnish_purge-3354158\src\Tests\VarnishPurgerFormTest.php
---------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
31 | ERROR | [ ] The @var tag must be the first tag in a member variable comment
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\varnish_purge-3354158\src\Tests\VarnishPurgerFormTestBase.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
49 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------
FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\varnish_purge-3354158\tests\src\Behat\features\bootstrap\VarnishPurgeFeatureContext.php
---------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
---------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
8 | ERROR | [x] There must be one blank line after the last USE statement; 0 found;
---------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------------
Time: 4.6 secs; Memory: 8MB
Steps to reproduce
Run the phpcs command on the module.
Use this below command with arguments
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml web/modules/custom/varnish_purge
Proposed resolution
Fix all the phpcs related issue.
Comment | File | Size | Author |
---|---|---|---|
#14 | interdiff-10-14.txt | 1.09 KB | nitin_lama |
#14 | fix_phpcs-3354158-14.patch | 32.81 KB | nitin_lama |
#11 | after patch.png | 362.35 KB | paraderojether |
#11 | before patch.png | 252 KB | paraderojether |
#10 | fix_phpcs-3354158-10.patch | 32.81 KB | Bhupesh_upadhyay |
Issue fork varnish_purge-3354158
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 #2
sidharth_soman CreditAttribution: sidharth_soman at Valuebound for Valuebound commentedAfter running the phpcs command on the module, I found the above coding standard errors/warnings as detailed in the issue summary. I'll work on fixing them.
Comment #4
sidharth_soman CreditAttribution: sidharth_soman at Valuebound for Valuebound commentedI have fixed all the isseus except for those relating to documentation and the naming conventions in VarnishPurgerSettings.php (I assume those were deliberate). I have issued an MR for the same. Please review.
Comment #5
apadernoThe issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.
Comment #6
Ashutosh Ahirwal CreditAttribution: Ashutosh Ahirwal at Specbee for Specbee commentedUpdated issue summmary.
Comment #7
paraderojether CreditAttribution: paraderojether at Promet Source commentedHi
I reviewed MR!12 and still getting phpcs issues shown below after running this command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml.
Please check.
Thank You.
Comment #8
nitin_lamaComment #9
nitin_lamaFixed most of the warnings/errors. Only remaining phpcs errors/warnings are these:
Comment #10
Bhupesh_upadhyay CreditAttribution: Bhupesh_upadhyay as a volunteer and at TO THE NEW commentedAll the issues are fixed including the remaining ones, Kindly review.
Comment #11
paraderojether CreditAttribution: paraderojether at Promet Source commentedI reviewed patch #10, applied against Varnish purger 8.x-2.x-dev, and confirme it fixes the issues reported by phpcs.
I added screenshots for reference.
Thank You.
Comment #12
apadernoIt is probably either one or the other of these sentences
@todo Add validation. is better.
Comment #13
nitin_lamaComment #14
nitin_lamaAddressed #12. Please review.
Comment #15
nitin_lamaComment #16
nisha_j CreditAttribution: nisha_j commentedHi, patch #10 fixes all the issues reported by phpcs and patch #14 addresses the issue mentioned in #12.
Thankyou.
Comment #17
apadernoSince there is already a MR, let's continue with that.
Comment #18
nitin_lamaComment #19
nitin_lamaComment #21
Yashaswi18 CreditAttribution: Yashaswi18 commentedRemaining issues:
Please review.