Problem/Motivation
phpstan reports:
------ ------------------------------------------------------------------------------
Line src/Negotiator.php
------ ------------------------------------------------------------------------------
85 \Drupal calls should be avoided in classes, use dependency injection instead
------ ------------------------------------------------------------------------------
However, the code already has $this->logger() defined.
Steps to reproduce
phpstan analyse consumers
Proposed resolution
Use the injected dependency instead of calling the static function.
Remaining tasks
Make an MR.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | consumers-dependency-injection-fix-3514510-6.patch | 1.11 KB | deimos |
Issue fork consumers-3514510
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
benstallings commentedComment #3
benstallings commentedComment #5
benstallings commentedComment #6
deimos commentedFix looks and works good!
Also adding a patch file for safer changes applying on site/projects.
Comment #9
eojthebraveThank you for cleaning up this bit of code. I've merged the update and it'll be in the next release.