Code Duplication    Length = 19-21 lines in 2 locations

src/Comodojo/Extender/Workers/QueueWorker.php 1 location

@@ 23-41 (lines=19) @@
20
    use EntityManagerTrait;
21
    use WorkerTrait;
22
23
    public function spinup() {
24
25
        $this->task_manager = new TaskManager(
26
            'queue.worker',
27
            $this->getConfiguration(),
28
            $this->getLogger(),
29
            $this->getTasksTable(),
30
            $this->getEvents(),
31
            $this->getEntityManager()
32
        );
33
34
        $this->job_manager = new QueueManager(
35
            $this->getConfiguration(),
36
            $this->getLogger(),
37
            $this->getEvents(),
38
            $this->getEntityManager()
39
        );
40
41
    }
42
43
    public function loop() {
44

src/Comodojo/Extender/Workers/ScheduleWorker.php 1 location

@@ 25-45 (lines=21) @@
22
23
    protected $wakeup_time = 0;
24
25
    public function spinup() {
26
27
        $this->task_manager = new TaskManager(
28
            'schedule.worker',
29
            $this->getConfiguration(),
30
            $this->getLogger(),
31
            $this->getTasksTable(),
32
            $this->getEvents(),
33
            $this->getEntityManager()
34
        );
35
36
        $this->getEvents()->subscribe('daemon.worker.refresh', '\Comodojo\Extender\Listeners\RefreshScheduler');
37
38
        $this->job_manager = new ScheduleManager(
39
            $this->getConfiguration(),
40
            $this->getLogger(),
41
            $this->getEvents(),
42
            $this->getEntityManager()
43
        );
44
45
    }
46
47
    public function loop() {
48