Completed
Push — master ( c86638...b1744c )
by Matze
03:42
created

Job::getStartTime()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
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 8
    /**
39
     * @param AbstractEvent $event
40 8
     * @param string $jobId
41 8
     * @param int $timestamp
42 8
     */
43 8
    public function __construct(AbstractEvent $event, string $jobId, int $timestamp)
44
    {
45
        $this->event     = $event;
46
        $this->jobId     = $jobId;
47
        $this->timestamp = $timestamp;
48 3
    }
49
50 3
    /**
51
     * @return string
52
     */
53
    public function getJobId() : string
54
    {
55
        return $this->jobId;
56 1
    }
57
58 1
    /**
59
     * @return int
60
     */
61
    public function getTimestamp() : int
62
    {
63
        return $this->timestamp;
64 3
    }
65
66 3
    /**
67
     * @return AbstractEvent
68
     */
69
    public function getEvent() : AbstractEvent
70
    {
71
        return $this->event;
72 1
    }
73
74 1
    /**
75 1
     * @param int $timestamp
76
     */
77
    public function setTimestamp(int $timestamp)
78
    {
79
        $this->timestamp = $timestamp;
80
    }
81
82
    /**
83
     * @return int
84
     */
85
    public function getStartTime(): int
86
    {
87
        return $this->startTime;
88
    }
89
}
90