From 72338167bccd29742d932cabf4ae4943a9be1069 Mon Sep 17 00:00:00 2001 From: Gowri Date: Wed, 7 Aug 2024 16:58:30 +0930 Subject: [PATCH 1/2] :wrench: get registered event sinks from factory --- Service/AsyncEvent/NotifierFactory.php | 8 ++++++++ Service/AsyncEvent/NotifierFactoryInterface.php | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/Service/AsyncEvent/NotifierFactory.php b/Service/AsyncEvent/NotifierFactory.php index be00ffd..a45375a 100644 --- a/Service/AsyncEvent/NotifierFactory.php +++ b/Service/AsyncEvent/NotifierFactory.php @@ -30,4 +30,12 @@ public function create(string $type): NotifierInterface return $notifier; } + + /** + * @inheritDoc + */ + public function getSinks(): array + { + return array_keys($this->notifierClasses); + } } diff --git a/Service/AsyncEvent/NotifierFactoryInterface.php b/Service/AsyncEvent/NotifierFactoryInterface.php index 58435ae..5b182c6 100644 --- a/Service/AsyncEvent/NotifierFactoryInterface.php +++ b/Service/AsyncEvent/NotifierFactoryInterface.php @@ -13,4 +13,11 @@ interface NotifierFactoryInterface * @return NotifierInterface */ public function create(string $type): NotifierInterface; + + /** + * Get available event sinks + * + * @return array + */ + public function getSinks(): array; } From 5bc9e4c7315b47da92475dbbc024d67139428a0d Mon Sep 17 00:00:00 2001 From: Gowri <40108018+gowrizrh@users.noreply.github.com> Date: Wed, 11 Sep 2024 12:12:39 +0930 Subject: [PATCH 2/2] Update NotifierFactoryInterface.php --- Service/AsyncEvent/NotifierFactoryInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Service/AsyncEvent/NotifierFactoryInterface.php b/Service/AsyncEvent/NotifierFactoryInterface.php index 5b182c6..5d43bb1 100644 --- a/Service/AsyncEvent/NotifierFactoryInterface.php +++ b/Service/AsyncEvent/NotifierFactoryInterface.php @@ -17,7 +17,7 @@ public function create(string $type): NotifierInterface; /** * Get available event sinks * - * @return array + * @return string[] */ public function getSinks(): array; }