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

Job   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 67
ccs 14
cts 14
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getJobId() 0 4 1
A getEvent() 0 4 1
A setTimestamp() 0 4 1
A getTimestamp() 0 4 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