Completed
Push — master ( 2db41f...aa6ae6 )
by Matthew
15:06 queued 36s
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
A getRunManager() 0 4 1
getJob() 0 1 ?
save() 0 1 ?
saveHistory() 0 1 ?
A resetStalledJobs() 0 4 1
A pruneStalledJobs() 0 4 1
A resetErroneousJobs() 0 4 1
A pruneErroneousJobs() 0 4 1
A getStatus() 0 4 1
A getJobCount() 0 4 1
A deleteJob() 0 4 1
A pruneExpiredJobs() 0 4 1
A pruneArchivedJobs() 0 4 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 31
    public function __construct(RunManager $runManager, JobTimingManager $jobTimingManager, $jobClass)
14
    {
15 31
        $this->runManager = $runManager;
16 31
        $this->jobTiminigManager = $jobTimingManager;
17 31
        $this->jobClass = $jobClass;
18 31
    }
19
20
    /**
21
     * @return string
22
     */
23 36
    public function getJobClass()
24
    {
25 36
        return $this->jobClass;
26
    }
27
28
    /**
29
     * @return JobTimingManager
30
     */
31 6
    public function getJobTimingManager()
32
    {
33 6
        return $this->jobTiminigManager;
34
    }
35
36
    /**
37
     * @return RunManager
38
     */
39 4
    public function getRunManager()
40
    {
41 4
        return $this->runManager;
42
    }
43
44
    abstract public function getJob($workerName = null, $methodName = null, $prioritize = true, $runId = null);
45
46
    abstract public function save(Job $job);
47
48
    abstract public function saveHistory(Job $job);
49
50 3
    public function resetStalledJobs($workerName = null, $method = null)
51
    {
52 3
        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 3
    public function pruneErroneousJobs($workerName = null, $methodName = null)
66
    {
67 3
        throw new UnsupportedException('Unsupported');
68
    }
69
70
    /**
71
     * @return array
72
     *
73
     * @throws UnsupportedException
74
     */
75 2
    public function getStatus()
76
    {
77 2
        throw new UnsupportedException('Unsupported');
78
    }
79
80 2
    public function getJobCount($workerName = null, $methodName = null)
81
    {
82 2
        throw new UnsupportedException('Unsupported');
83
    }
84
85 1
    public function deleteJob(Job $job)
86
    {
87 1
        throw new UnsupportedException('Unsupported');
88
    }
89
90 3
    public function pruneExpiredJobs($workerName = null, $methodName = null)
91
    {
92 3
        throw new UnsupportedException('Unsupported');
93
    }
94
95 3
    public function pruneArchivedJobs(\DateTime $olderThan)
96
    {
97 3
        throw new UnsupportedException('Unsupported');
98
    }
99
}
100