End   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 97
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
eloc 17
c 1
b 0
f 0
dl 0
loc 97
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getExitStatus() 0 3 1
A queue() 0 3 1
A __construct() 0 12 1
A context() 0 3 1
A startTime() 0 3 1
A name() 0 3 1
A endTime() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BinaryCube\CarrotMQ\Event\Consumer;
6
7
use Interop\Queue\Context;
8
use BinaryCube\CarrotMQ\Event\Event;
9
use BinaryCube\CarrotMQ\Entity\Queue;
10
11
/**
12
 * Class End
13
 */
14
class End extends Event
15
{
16
17
    /**
18
     * @var Queue
19
     */
20
    private $queue;
21
22
    /**
23
     * @var Context
24
     */
25
    private $context;
26
27
    /**
28
     * @var float
29
     */
30
    private $startTime;
31
32
    /**
33
     * @var float
34
     */
35
    private $endTime;
36
37
    /**
38
     * @var integer
39
     */
40
    private $exitStatus;
41
42
    /**
43
     * @return string
44
     */
45
    public static function name(): string
46
    {
47
        return 'consumer.event.end';
48
    }
49
50
    /**
51
     * Constructor.
52
     *
53
     * @param Queue    $queue
54
     * @param Context  $context
55
     * @param float    $startTime
56
     * @param float    $endTime
57
     * @param int|null $exitStatus
58
     */
59
    public function __construct(
60
        Queue $queue,
61
        Context $context,
62
        float $startTime,
63
        float $endTime,
64
        ?int $exitStatus = null
65
    ) {
66
        $this->queue      = $queue;
67
        $this->context    = $context;
68
        $this->startTime  = $startTime;
69
        $this->endTime    = $endTime;
70
        $this->exitStatus = $exitStatus;
71
    }
72
73
    /**
74
     * @return Queue
75
     */
76
    public function queue(): Queue
77
    {
78
        return $this->queue;
79
    }
80
81
    /**
82
     * @return Context
83
     */
84
    public function context(): Context
85
    {
86
        return $this->context;
87
    }
88
89
    /**
90
     * @return float
91
     */
92
    public function startTime(): float
93
    {
94
        return $this->startTime;
95
    }
96
97
    /**
98
     * @return float
99
     */
100
    public function endTime(): float
101
    {
102
        return $this->endTime;
103
    }
104
105
    /**
106
     * @return int|null
107
     */
108
    public function getExitStatus(): ?int
109
    {
110
        return $this->exitStatus;
111
    }
112
113
}
114