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

ShellJob::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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