getOption(self::OPTION_WEBHOOKS); if (!isset($webhooks[$id])) { return null; } try { return $this->getWebhookEntryFactory()->createEntryFromArray($webhooks[$id]); } catch (\InvalidArgumentException $exception) { throw new \InvalidArgumentException("Invalid '$id' webhook config. " . $exception->getMessage()); } } /** * @param string $eventName * @return string[] */ public function getWebhookConfigIds($eventName) { $events = $this->getOption(self::OPTION_EVENTS); return isset($events[$eventName]) ? $events[$eventName] : []; } /** * @return WebhookEntryFactory */ private function getWebhookEntryFactory() { /** @noinspection PhpIncompatibleReturnTypeInspection */ return $this->getServiceLocator()->get(WebhookEntryFactory::class); } }