src/PortoContainers/Zapier/EventSubscriber/ParcelSubscriber.php line 36
<?phpnamespace App\PortoContainers\Zapier\EventSubscriber;use App\Event\TrackingCreatedEvent;use App\PortoContainers\Zapier\Actions\AddTriggerAction;use App\PortoContainers\Zapier\DTO\ZapierTriggerData;use App\PortoContainers\Zapier\Entities\ZapierTrigger;use Symfony\Component\EventDispatcher\EventSubscriberInterface;class ParcelSubscriber implements EventSubscriberInterface{/*** @param AddTriggerAction $addTriggerAction*/public function __construct(private readonly AddTriggerAction $addTriggerAction){}/*** @return array*/public static function getSubscribedEvents(): array{return [TrackingCreatedEvent::class => ['trackingCreatedEvent', -100]];}/*** @param TrackingCreatedEvent $event* @return void* @throws \Exception*/public function trackingCreatedEvent(TrackingCreatedEvent $event): void{$this->addTriggerAction->run(new ZapierTriggerData(ZapierTrigger::TRIGGER_TRACKING_CREATED,$event->getParcel()->getId()));}}