mailchimp-bundle icon indicating copy to clipboard operation
mailchimp-bundle copied to clipboard

[Symfony 5] Symfony\Component\EventDispatcher\Event is replaced by Symfony/Contracts/EventDispatcher/Event

Open Roensby opened this issue 4 years ago • 4 comments

Symfony/Component/EventDispatcher/Event is deprecated in Symfony 4.3 and replaced with Symfony/Contracts/EventDispatcher/Event in Symfony 5.

Applies to src/Event/SubscriberEvent.php and src/Event/WebhookEvent.php.

Maybe a candidate for the 2.0 branch mentioned? https://github.com/welpdev/mailchimp-bundle/issues/31

Roensby avatar Aug 13 '21 08:08 Roensby

Hey, thanks! sure thing, as I said in latest PR https://github.com/welpdev/mailchimp-bundle/pull/39#issuecomment-894338936, I'm not using this anymore, not even using Mailchimp, so if you're interested to become a maintainer and work on the v2.X feel free to ask me :ok_hand:

Nightbr avatar Aug 13 '21 08:08 Nightbr

I fixed this issue in a fork https://packagist.org/packages/dx-solutions/mailchimp-bundle

EvertAlbert avatar Oct 18 '21 13:10 EvertAlbert

Feel free to open a PR or I can put you as maintainer if you want @EvertAlbert

Nightbr avatar Oct 18 '21 14:10 Nightbr

I'm getting the same error : Attempted to load class "Event" from namespace "Symfony\Component\EventDispatcher". Did you forget a "use" statement for e.g. "Symfony\Contracts\EventDispatcher\Event"? when I call newUser method :

 public function newUser(Abonne $abonne)
    {
        // ...

        $subscriber = new Subscriber($abonne->getEmail(), [
            'FIRSTNAME' => $abonne->getName(),
        ], [
            'language' => 'fr'
        ]);

        $this->eventDispatcher->dispatch(
            new SubscriberEvent($this->listId, $subscriber),
            SubscriberEvent::EVENT_SUBSCRIBE
            
        );
    }

kasali avatar Jan 19 '24 09:01 kasali