diff options
Diffstat (limited to 'app/ServiceProvider/EventDispatcherProvider.php')
-rw-r--r-- | app/ServiceProvider/EventDispatcherProvider.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/app/ServiceProvider/EventDispatcherProvider.php b/app/ServiceProvider/EventDispatcherProvider.php new file mode 100644 index 00000000..90210ba6 --- /dev/null +++ b/app/ServiceProvider/EventDispatcherProvider.php @@ -0,0 +1,28 @@ +<?php + +namespace ServiceProvider; + +use Pimple\Container; +use Pimple\ServiceProviderInterface; +use Subscriber\NotificationSubscriber; +use Subscriber\ProjectActivitySubscriber; +use Subscriber\ProjectDailySummarySubscriber; +use Subscriber\ProjectModificationDateSubscriber; +use Subscriber\WebhookSubscriber; +use Symfony\Component\EventDispatcher\EventDispatcher; + +class EventDispatcherProvider implements ServiceProviderInterface +{ + public function register(Container $container) + { + $container['dispatcher'] = new EventDispatcher; + $container['dispatcher']->addSubscriber(new ProjectActivitySubscriber($container)); + $container['dispatcher']->addSubscriber(new ProjectDailySummarySubscriber($container)); + $container['dispatcher']->addSubscriber(new ProjectModificationDateSubscriber($container)); + $container['dispatcher']->addSubscriber(new WebhookSubscriber($container)); + $container['dispatcher']->addSubscriber(new NotificationSubscriber($container)); + + // Automatic actions + $container['action']->attachEvents(); + } +} |