Completed
Pull Request — master (#27)
by Matthew
20:41 queued 16:25
created

AbstractJobManager::getRunManager()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 1
cts 1
cp 1
cc 1
eloc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Dtc\QueueBundle\Model;
4
5
use Dtc\QueueBundle\Exception\UnsupportedException;
6
7
abstract class AbstractJobManager implements JobManagerInterface
8
{
9
    protected $jobTiminigManager;
10
    protected $jobClass;
11
    protected $runManager;
12
13
    public function __construct(RunManager $runManager, JobTimingManager $jobTimingManager, $jobClass)
14
    {
15 3
        $this->runManager = $runManager;
16
        $this->jobTiminigManager = $jobTimingManager;
17 3
        $this->jobClass = $jobClass;
18
    }
19
20 3
    /**
21
     * @return string
22 3
     */
23
    public function getJobClass()
24
    {
25 3
        return $this->jobClass;
26
    }
27 3
28
    /**
29
     * @return JobTimingManager
30 3
     */
31
    public function getJobTimingManager()
32 3
    {
33
        return $this->jobTiminigManager;
34
    }
35
36
    /**
37
     * @return RunManager
38
     */
39
    public function getRunManager()
40 2
    {
41
        return $this->runManager;
42 2
    }
43
44
    abstract public function getJob($workerName = null, $methodName = null, $prioritize = true, $runId = null);
45 2
46
    abstract public function save(Job $job);
47 2
48
    abstract public function saveHistory(Job $job);
49
50 1
    public function resetStalledJobs($workerName = null, $method = null)
51
    {
52 1
        throw new UnsupportedException('Unsupported');
53
    }
54
55 3
    public function pruneStalledJobs($workerName = null, $method = null)
56
    {
57 3
        throw new UnsupportedException('Unsupported');
58
    }
59
60 3
    public function resetErroneousJobs($workerName = null, $methodName = null)
61
    {
62 3
        throw new UnsupportedException('Unsupported');
63
    }
64
65
    public function pruneErroneousJobs($workerName = null, $methodName = null)
66
    {
67
        throw new UnsupportedException('Unsupported');
68
    }
69
70
    /**
71
     * @return array
72
     *
73
     * @throws UnsupportedException
74
     */
75
    public function getStatus()
76
    {
77
        throw new UnsupportedException('Unsupported');
78
    }
79
80
    public function getJobCount($workerName = null, $methodName = null)
81
    {
82
        throw new UnsupportedException('Unsupported');
83
    }
84
85
    public function deleteJob(Job $job)
86
    {
87
        throw new UnsupportedException('Unsupported');
88
    }
89
90
    public function pruneExpiredJobs($workerName = null, $methodName = null)
91
    {
92
        throw new UnsupportedException('Unsupported');
93
    }
94
95
    public function pruneArchivedJobs(\DateTime $olderThan)
96
    {
97
        throw new UnsupportedException('Unsupported');
98
    }
99
}
100