Problem/Motivation
FILE: src/Form/SettingsForm.php
---------------------------------------------------------------------------------------------------------------
293 | WARNING | Vocabulary::loadMultiple calls should be avoided in classes, use dependency injection instead
---------------------------------------------------------------------------------------------------------------
Steps to reproduce
Run phpcs.
Proposed resolution
Use dependency injection by using entity_type.manager and taxonomy_vocabulary.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | interdiff_2-4.txt | 742 bytes | victoria-marina |
| #4 | 3258332-4.patch | 3.27 KB | victoria-marina |
Comments
Comment #2
j-barnes commentedComment #3
victoria-marina commentedComment #4
victoria-marina commentedI've installed the module, reproduced the issue with phpcs, applied the patch e saw the changes. The patch works, everything is ok, but when I run the phpcs, I got those 2 warnings:
FILE: src/Form/SettingsForm.php
---------------------------------------------------------------------------------------------------------------
195 | WARNING | #description values usually have to run through t() for translation
208 | WARNING | #description values usually have to run through t() for translation
---------------------------------------------------------------------------------------------------------------
So a I made a patch for them as well.
Comment #5
victoria-marina commentedHere is the interdiff.
Comment #6
tmaiochi commentedComment #7
tmaiochi commentedThe patch resolve all PHPCS errors, except for a var not used, but it's a http request so I think it's fine keep it like that, but the final decision is up to the maintainer.
Comment #9
bartvig commentedFixed in version 1.12.