2021-05-24 18:41:57 +02:00
|
|
|
<?php
|
|
|
|
|
2022-03-10 21:32:22 +01:00
|
|
|
namespace App\Core\EventSubscriber\Task;
|
2021-05-24 18:41:57 +02:00
|
|
|
|
|
|
|
use App\Core\Event\Task\TaskInitEvent;
|
2021-05-24 18:42:44 +02:00
|
|
|
use App\Core\Event\Task\TaskRunRequestedEvent;
|
|
|
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
2021-05-24 18:41:57 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* class TaskEventSubscriber.
|
|
|
|
*
|
|
|
|
* @author Simon Vieille <simon@deblan.fr>
|
|
|
|
*/
|
|
|
|
abstract class TaskEventSubscriber implements EventSubscriberInterface
|
|
|
|
{
|
|
|
|
protected static int $priority = 0;
|
|
|
|
|
|
|
|
public static function getSubscribedEvents()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
TaskInitEvent::INIT_EVENT => ['onInit', self::$priority],
|
|
|
|
TaskRunRequestedEvent::RUN_REQUEST_EVENT => ['onRunRequest', self::$priority],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function onInit(TaskInitEvent $event)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function onRunRequest(TaskRunRequestedEvent $event)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|