src/Offer/EventSubscriber/SendOfferEmailSubscriber.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\OfferEmail\CreatedEvent;use App\Offer\Service\OfferEmailServiceInterface;use JetBrains\PhpStorm\ArrayShape;use Symfony\Component\EventDispatcher\EventSubscriberInterface;final class SendOfferEmailSubscriber implements EventSubscriberInterface{private OfferEmailServiceInterface $service;public function __construct(OfferEmailServiceInterface $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());}}