Completed
Push — master ( 5e1cd2...38f1ea )
by Matze
03:32
created

Job::getEvent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
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 integer
25
     */
26
    public $timestamp;
27
28
    /**
29
     * @var int
30
     */
31
    public $errorCounter = 0;
32
33
    /**
34
     * @param AbstractEvent $event
35
     * @param string $jobId
36
     * @param integer $timestamp
37
     */
38 8
    public function __construct(AbstractEvent $event, string $jobId, int $timestamp)
39
    {
40 8
        $this->event     = $event;
41 8
        $this->jobId     = $jobId;
42 8
        $this->timestamp = $timestamp;
43 8
    }
44
45
    /**
46
     * @return string
47
     */
48 3
    public function getJobId() : string
49
    {
50 3
        return $this->jobId;
51
    }
52
53
    /**
54
     * @return int
55
     */
56 1
    public function getTimestamp() : int
57
    {
58 1
        return $this->timestamp;
59
    }
60
61
    /**
62
     * @return AbstractEvent
63
     */
64 3
    public function getEvent() : AbstractEvent
65
    {
66 3
        return $this->event;
67
    }
68
69
    /**
70
     * @param int $timestamp
71
     */
72 1
    public function setTimestamp(int $timestamp)
73
    {
74 1
        $this->timestamp = $timestamp;
75 1
    }
76
}
77