Problem/Motivation
I use Drupal 11.3.
I created a Hook handler class, which is auto-wiring dependencies by default.
I don't need to declare the Hook service in the services.yml.
In my custom service I was not able to auto-wire the spamspan service.
Steps to reproduce
Create a custom service, and dependency inject the spamspan service.
Cannot autowire service: argument "$spamspan" of method "__construct()" references class "Drupal\spamspan\SpamspanService" but no such service exists. You should maybe alias this class to the existing "spamspan" service.
Proposed resolution
I found the solution here:
https://symfony.com/doc/3.x/service_container/autowiring.html#using-alia...
services:
Drupal\spamspan\SpamspanService: '@spamspan'
Remaining tasks
I will create a merge request.
Issue fork spamspan-3570600
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 #3
imre.horjanComment #4
joevagyok commentedThank you!
Comment #5
joevagyok commented