Completed
Pull Request — master (#30)
by Matthew
11:23
created

AbstractJobManager   A

Complexity

Total Complexity 13

Size/Duplication

Total Lines 93
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 13
lcom 0
cbo 1
dl 0
loc 93
ccs 29
cts 29
cp 1
rs 10
c 0
b 0
f 0

16 Methods

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