summaryrefslogtreecommitdiff
path: root/app/ServiceProvider/JobProvider.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/ServiceProvider/JobProvider.php')
-rw-r--r--app/ServiceProvider/JobProvider.php67
1 files changed, 67 insertions, 0 deletions
diff --git a/app/ServiceProvider/JobProvider.php b/app/ServiceProvider/JobProvider.php
new file mode 100644
index 00000000..2194b11c
--- /dev/null
+++ b/app/ServiceProvider/JobProvider.php
@@ -0,0 +1,67 @@
+<?php
+
+namespace Kanboard\ServiceProvider;
+
+use Kanboard\Job\CommentEventJob;
+use Kanboard\Job\NotificationJob;
+use Kanboard\Job\ProjectFileEventJob;
+use Kanboard\Job\ProjectMetricJob;
+use Kanboard\Job\SubtaskEventJob;
+use Kanboard\Job\TaskEventJob;
+use Kanboard\Job\TaskFileEventJob;
+use Kanboard\Job\TaskLinkEventJob;
+use Pimple\Container;
+use Pimple\ServiceProviderInterface;
+
+/**
+ * Class JobProvider
+ *
+ * @package Kanboard\ServiceProvider
+ * @author Frederic Guillot
+ */
+class JobProvider implements ServiceProviderInterface
+{
+ /**
+ * Register providers
+ *
+ * @access public
+ * @param \Pimple\Container $container
+ * @return \Pimple\Container
+ */
+ public function register(Container $container)
+ {
+ $container['commentEventJob'] = $container->factory(function ($c) {
+ return new CommentEventJob($c);
+ });
+
+ $container['subtaskEventJob'] = $container->factory(function ($c) {
+ return new SubtaskEventJob($c);
+ });
+
+ $container['taskEventJob'] = $container->factory(function ($c) {
+ return new TaskEventJob($c);
+ });
+
+ $container['taskFileEventJob'] = $container->factory(function ($c) {
+ return new TaskFileEventJob($c);
+ });
+
+ $container['taskLinkEventJob'] = $container->factory(function ($c) {
+ return new TaskLinkEventJob($c);
+ });
+
+ $container['projectFileEventJob'] = $container->factory(function ($c) {
+ return new ProjectFileEventJob($c);
+ });
+
+ $container['notificationJob'] = $container->factory(function ($c) {
+ return new NotificationJob($c);
+ });
+
+ $container['projectMetricJob'] = $container->factory(function ($c) {
+ return new ProjectMetricJob($c);
+ });
+
+ return $container;
+ }
+}