Problem/Motivation
Getting following warnings.
FILE: /var/www/html/modules/contrib/taxonomy_bootstrap_accordion/src/Plugin/Block/TaxonomyMenuBlock.php
---------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
---------------------------------------------------------------------------------------------------------------
131 | WARNING | Vocabulary::loadMultiple calls should be avoided in classes, use dependency injection instead
134 | WARNING | Unused variable $machine.
154 | WARNING | Vocabulary::load calls should be avoided in classes, use dependency injection instead
224 | WARNING | Vocabulary::loadMultiple calls should be avoided in classes, use dependency injection instead
---------------------------------------------------------------------------------------------------------------
Time: 729ms; Memory: 6MB
Steps to reproduce
Run following command
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/taxonomy_bootstrap_accordion/
Proposed resolution
Above warnings need to be fixed.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3350069-2.patch | 1.86 KB | samitk |
Comments
Comment #2
samitk commentedAbove warnings has been fixed.
Comment #3
adil_siddiqui commentedPatch applied successfully and all the warnings specified are resolved...Marking as RTBC
Comment #4
avpadernoComment #6
shelaneThanks. I also updated the use statements order.