Closed (fixed)
Project:
Group Notify
Version:
8.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
13 Nov 2025 at 20:29 UTC
Updated:
28 Nov 2025 at 01:24 UTC
Jump to comment: Most recent
phpstan was complaining about:
------ ----------------------------------------------------------------------
Line src/Plugin/Group/Relation/NotifyGroupNode.php
------ ----------------------------------------------------------------------
289 \Drupal calls should be avoided in classes, use dependency injection
instead
------ ----------------------------------------------------------------------
That's for this line:
return \Drupal::token()->replace($subject_config, $context);
For #3557728: Add GitLab CI pipelines and get all jobs passing I added this to the phpstan-baseline.neon for the project. However, it could be nice to fix this up to properly inject the token service, instead.
Use DI to inject the token service for NotifyGroupNode
Remove this case from phpstan-baseline.neon
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 #4
dwwIn the absence of real automated tests, I did some manual local testing for this. It's working fine in 8.x-1.x branch. It's basically identical code for 2.0.x branch (the file just moved), so I have high confidence it works there, too. 😅 Pipelines are all green, so I know I didn't botch the phpstan baseline stuff.
Comment #7
dww