Problem
The bundle registers WebPush\WebPush as a service in the container (in Resources/config/services.php), but does not create an alias for the WebPush\WebPushService interface it implements.
This means users who properly type-hint the interface (following dependency inversion principle) get an autowiring error:
Cannot autowire service "...SendPushNotificationHandler": argument "$webPush" of method "__construct()"
references interface "WebPush\WebPushService" but no such service exists.
You should maybe alias this interface to one of these existing services: "WebPush\WebPush", "web_push.service".
Expected Behavior
The bundle should register an alias from WebPush\WebPushService to WebPush\WebPush so that autowiring works with the interface.
Current Workaround
Adding a manual alias in services.yaml:
WebPush\WebPushService: '@WebPush\WebPush'
Suggested Fix
In web-push-bundle/Resources/config/services.php, add:
$container->alias(WebPushService::class, WebPush::class);
Problem
The bundle registers
WebPush\WebPushas a service in the container (inResources/config/services.php), but does not create an alias for theWebPush\WebPushServiceinterface it implements.This means users who properly type-hint the interface (following dependency inversion principle) get an autowiring error:
Expected Behavior
The bundle should register an alias from
WebPush\WebPushServicetoWebPush\WebPushso that autowiring works with the interface.Current Workaround
Adding a manual alias in
services.yaml:Suggested Fix
In
web-push-bundle/Resources/config/services.php, add: