Problem/Motivation
FILE: /home/lenovo/d7to9/web/modules/contrib/adv_varnish/adv_varnish.module
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 2 WARNINGS AFFECTING 6 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
76 | ERROR | [ ] The array declaration extends to column 108 (the limit is 80). The array content should be split up over multiple lines
77 | ERROR | [ ] The array declaration extends to column 98 (the limit is 80). The array content should be split up over multiple lines
175 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
227 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
229 | ERROR | [x] Array indentation error, expected 6 spaces but found 4
229 | ERROR | [x] Closing parenthesis of array declaration must be on a new line
251 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------
FILE: /home/lenovo/d7to9/web/modules/contrib/adv_varnish/src/CookieManager.php
---------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------------------------------------------------------
128 | ERROR | The $_COOKIE super global must not be accessed directly; inject the request_stack service and use
| | $stack->getCurrentRequest()->cookies->get(static::COOKIE_BIN) instead
131 | ERROR | The $_COOKIE super global must not be accessed directly; inject the request_stack service and use
| | $stack->getCurrentRequest()->cookies->get(static::COOKIE_BIN) instead
205 | ERROR | The $_COOKIE super global must not be accessed directly; inject the request_stack service and use
| | $stack->getCurrentRequest()->cookies instead
---------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /home/lenovo/d7to9/web/modules/contrib/adv_varnish/src/EventSubscriber/RouteSubscriber.php
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Config\ConfigFactoryInterface.
-----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------
FILE: /home/lenovo/d7to9/web/modules/contrib/adv_varnish/src/EventSubscriber/CacheableResponseSubscriber.php
----------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\adv_varnish\CacheManagerInterface.
----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------
FILE: /home/lenovo/d7to9/web/modules/contrib/adv_varnish/src/CacheManager.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 6 WARNINGS AFFECTING 8 LINES
---------------------------------------------------------------------------------------------------------------------------------------
16 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Config\ConfigFactoryInterface.
188 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
197 | WARNING | [x] '@TODO: replace X-Varnish-Purge to the const.' should match the format '@todo Fix problem X here.'
212 | WARNING | [x] '@TODO: use the const.' should match the format '@todo Fix problem X here.'
228 | WARNING | [x] '@TODO: use the const.' should match the format '@todo Fix problem X here.'
355 | WARNING | [ ] Line exceeds 80 characters; contains 113 characters
434 | WARNING | [ ] NodeType::load calls should be avoided in classes, use dependency injection instead
485 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
---------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------
FILE: /home/lenovo/d7to9/web/modules/contrib/adv_varnish/src/UserBlocksManager.php
---------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Cache\CacheBackendInterface.
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------
FILE: /home/lenovo/d7to9/web/modules/contrib/adv_varnish/src/Form/CacheSettingsForm.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\ConfigFormBase.
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------
FILE: /home/lenovo/d7to9/web/modules/contrib/adv_varnish/src/Form/ClearCacheForm.php
----------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\adv_varnish\CacheManagerInterface.
----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------
FILE: /home/lenovo/d7to9/web/modules/contrib/adv_varnish/src/Form/CacheBlockForm.php
-----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------------
16 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\StringTranslation\StringTranslationTrait.
-----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------
FILE: /home/lenovo/d7to9/web/modules/contrib/adv_varnish/src/Controller/UserBlocksController.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------
10 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Serialization\Json.
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------
FILE: /home/lenovo/d7to9/web/modules/contrib/adv_varnish/src/Controller/ESIBlockController.php
------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------
71 | WARNING | [ ] Block::load calls should be avoided in classes, use dependency injection instead
100 | ERROR | [x] Expected 1 space(s) after cast statement; 0 found
103 | ERROR | [x] Expected 1 space(s) after cast statement; 0 found
------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------
FILE: /home/lenovo/d7to9/web/modules/contrib/adv_varnish/adv_varnish.links.task.yml
-----------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------
18 | ERROR | [x] Expected 1 newline at end of file; 0 found
-----------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------
FILE: /home/lenovo/d7to9/web/modules/contrib/adv_varnish/tests/modules/adv_varnish_block_test/adv_varnish_block_test.info.yml
-----------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-----------------------------------------------------------------------------------------------------------------------------
FILE: /home/lenovo/d7to9/web/modules/contrib/adv_varnish/tests/modules/adv_varnish_block_test/src/Plugin/UserBlocks/Example.php
----------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\StringTranslation\StringTranslationTrait.
----------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------
FILE: /home/lenovo/d7to9/web/modules/contrib/adv_varnish/tests/src/Functional/NodeCachingTest.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------------------------------
58 | ERROR | The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
118 | ERROR | The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
142 | ERROR | The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------
Time: 377ms; Memory: 12MB
Steps to reproduce
Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig adv_varnish/
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
roshni27 commentedSome issues remain which better know to maintainer other all isuues solved. please review the patch.
Comment #3
akshay.singh commentedComment #4
mrinalini9 commentedHi,
I have reviewed patch #2, it applied cleanly and resolved some of the issues mentioned above but still getting below errors/warnings that need to be fixed:
So, moving this to Needs Work.
Thanks!
Comment #5
nitin_lamaComment #6
nitin_lamaFixed most of the issues.
Only remaining issue is of DI.
Comment #7
nitin_lamaComment #10
zkhan.aamir commentedComment #11
zkhan.aamir commentedComment #12
bhaveshdas commentedI applied MR!13 and I still encountered some issues after I ran vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig modules/custom/adv_varnish-3373546/
Comment #13
shumer commentedThat was fixed https://www.drupal.org/project/adv_varnish/issues/3576436