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.

Comments

j-barnes created an issue. See original summary.

j-barnes’s picture

StatusFileSize
new2.58 KB
victoria-marina’s picture

Assigned: Unassigned » victoria-marina
victoria-marina’s picture

StatusFileSize
new3.27 KB

I'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.

victoria-marina’s picture

Assigned: victoria-marina » Unassigned
StatusFileSize
new742 bytes

Here is the interdiff.

tmaiochi’s picture

Assigned: Unassigned » tmaiochi
tmaiochi’s picture

Assigned: tmaiochi » Unassigned
Status: Needs review » Reviewed & tested by the community

The 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.

bartvig’s picture

Status: Reviewed & tested by the community » Fixed

Fixed in version 1.12.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.