src/Offer/EventSubscriber/SendOfferDraftEmailSubscriber.php line 43
<?phpdeclare(strict_types=1);/*** Copyright (c) 2021 TECLA Consulting Group oü.* All rights reserved.** This unpublished material is proprietary to TECLA Consulting Group oü.* All rights reserved. The methods and* techniques described herein are considered trade secrets* and/or confidential. Reproduction or distribution, in whole* or in part, is forbidden except by express written permission* of TECLA Consulting Group oü.** @author Matúš Sýkorjak <matus@tecla.no>* @copyright 2021 TECLA Consulting Group oü*/namespace App\Offer\EventSubscriber;use App\Offer\Event\OfferDraftEmail\CreatedEvent;use App\Offer\Service\OfferDraftEmailServiceInterface;use JetBrains\PhpStorm\ArrayShape;use Symfony\Component\EventDispatcher\EventSubscriberInterface;final class SendOfferDraftEmailSubscriber implements EventSubscriberInterface{private OfferDraftEmailServiceInterface $service;public function __construct(OfferDraftEmailServiceInterface $service){$this->service = $service;}#[ArrayShape([CreatedEvent::class => 'array'])]public static function getSubscribedEvents(): array{return [CreatedEvent::class => ['onCreated', 0],];}public function onCreated(CreatedEvent $event): void{$this->service->send($event->getEmail());}}