JobEndedEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
1
<?php
2
namespace T4web\Cron;
3
4
use Zend\EventManager\Event;
5
use Cron\Report\JobReport;
6
use T4web\Cron\Job\ShellJob;
7
8
/**
9
 * Class AuthenticationEvent
10
 */
11
class JobEndedEvent extends Event
12
{
13
    /**
14
     * Events triggered by eventmanager
15
     */
16
    const EVENT_JOB_ENDED = 'cronjob-ended';
17
18
    /**
19
     * @var JobReport
20
     */
21
    private $report;
22
23
    /**
24
     * @var ShellJob
25
     */
26
    private $job;
27
28
    /**
29
     * Constructor
30
     *
31
     * Accept a target and its parameters.
32
     *
33
     * @param  string $name Event name
34
     * @param  string|object $target
35
     * @param  array|\ArrayAccess $params
36
     */
37
    public function __construct($name = null, $target = null, $params = null)
38
    {
39
        parent::__construct(self::EVENT_JOB_ENDED, $target, $params);
40
    }
41
42
    /**
43
     * @param JobReport $report
44
     * @return $this
45
     */
46
    public function setReport(JobReport $report)
47
    {
48
        $this->report = $report;
49
        return $this;
50
    }
51
52
    /**
53
     * @return JobReport
54
     */
55
    public function getReport()
56
    {
57
        return $this->report;
58
    }
59
60
    /**
61
     * @return ShellJob
62
     */
63
    public function getJob()
64
    {
65
        return $this->job;
66
    }
67
68
    /**
69
     * @param ShellJob $job
70
     * @return $this
71
     */
72
    public function setJob($job)
73
    {
74
        $this->job = $job;
75
        return $this;
76
    }
77
}
78