Completed
Push — master ( b1744c...51aee2 )
by Matze
04:34
created

Job::setStartTime()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace BrainExe\Core\MessageQueue;
4
5
use BrainExe\Core\EventDispatcher\AbstractEvent;
6
7
/**
8
 * @api can be used by other components
9
 */
10
class Job
11
{
12
13
    /**
14
     * @var AbstractEvent
15
     */
16
    public $event;
17
18
    /**
19
     * @var string
20
     */
21
    public $jobId;
22
23
    /**
24
     * @var int
25
     */
26
    public $timestamp;
27
28
    /**
29
     * @var int
30
     */
31
    public $startTime;
32
33
    /**
34
     * @var int
35
     */
36
    public $errorCounter = 0;
37
38
    /**
39
     * @param AbstractEvent $event
40
     * @param string $jobId
41
     * @param int $timestamp
42
     */
43 8
    public function __construct(AbstractEvent $event, string $jobId, int $timestamp)
44
    {
45 8
        $this->event     = $event;
46 8
        $this->jobId     = $jobId;
47 8
        $this->timestamp = $timestamp;
48 8
    }
49
50
    /**
51
     * @return string
52
     */
53 3
    public function getJobId() : string
54
    {
55 3
        return $this->jobId;
56
    }
57
58
    /**
59
     * @return int
60
     */
61 1
    public function getTimestamp() : int
62
    {
63 1
        return $this->timestamp;
64
    }
65
66
    /**
67
     * @return AbstractEvent
68
     */
69 3
    public function getEvent() : AbstractEvent
70
    {
71 3
        return $this->event;
72
    }
73
74
    /**
75
     * @param int $timestamp
76
     */
77 1
    public function setTimestamp(int $timestamp)
78
    {
79 1
        $this->timestamp = $timestamp;
80 1
    }
81
82
    /**
83
     * @return int
84
     */
85 1
    public function getStartTime(): int
86
    {
87 1
        return $this->startTime;
88
    }
89
90
    /**
91
     * @param int $startTime
92
     */
93 1
    public function setStartTime(int $startTime)
94
    {
95 1
        $this->startTime = $startTime;
96 1
    }
97
}
98