src/Offer/EventSubscriber/UpdateOfferStatusSubscriber.php line 44
<?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\Enum\OfferStatus;use App\Offer\Event\OfferEmail\SentEvent;use App\Offer\Service\OfferServiceInterface;use JetBrains\PhpStorm\ArrayShape;use Symfony\Component\EventDispatcher\EventSubscriberInterface;final class UpdateOfferStatusSubscriber implements EventSubscriberInterface{private OfferServiceInterface $service;public function __construct(OfferServiceInterface $service){$this->service = $service;}#[ArrayShape([SentEvent::class => 'array'])]public static function getSubscribedEvents(): array{return [SentEvent::class => ['onSent', 0],];}public function onSent(SentEvent $event): void{$this->service->updateStatus($event->getEmail()->getOffer(), OfferStatus::SENT());}}