Completed
Push — master ( 0f4012...9997db )
by max
03:05
created

ShellJob   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 4
c 2
b 0
f 2
lcom 1
cbo 1
dl 0
loc 39
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getId() 0 4 1
A getReport() 0 8 2
1
<?php
2
3
namespace T4web\Cron\Job;
4
5
use Cron\Job\ShellJob as BaseShellJob;
6
use Cron\Schedule\ScheduleInterface;
7
use Cron\Report\ReportInterface;
8
9
class ShellJob extends BaseShellJob
10
{
11
    /**
12
     * @var string
13
     */
14
    private $id;
15
16
    /**
17
     * @param string $id
18
     * @param string $command
19
     * @param ScheduleInterface $schedule
20
     */
21
    public function __construct($id, $command, ScheduleInterface $schedule)
22
    {
23
        $this->id = $id;
24
        $this->setCommand($command);
25
        $this->setSchedule($schedule);
26
    }
27
28
    /**
29
     * @return string
30
     */
31
    public function getId()
32
    {
33
        return $this->id;
34
    }
35
36
    /**
37
     * @return ReportInterface
38
     */
39
    public function getReport()
40
    {
41
        if (!$this->report) {
42
            $this->report = $this->createReport();
43
        }
44
45
        return $this->report;
46
    }
47
}
48