web-push-bundle icon indicating copy to clipboard operation
web-push-bundle copied to clipboard

The "minishlink_web_push" service or alias has been removed or inlined when the container was compiled.

Open galphanet opened this issue 4 years ago • 1 comments

When using Symfony 4, this bundle cannot be called with $this->getContainer()->get('minishlink_web_push');

The fix is to declare the minishlink_web_push service as public.

Thanks !

galphanet avatar Apr 08 '20 18:04 galphanet

When using dependency injection no public service is required, but it would be nice if the readme reflects this :)

namespace App\Service;

use Minishlink\WebPush\WebPush;

class SomeService
{

    private WebPush $webPush;

    public function __construct(WebPush $webpush)
    {
        $this->webPush = $webpush;
    }
}

veldenb avatar Oct 23 '20 19:10 veldenb