Passed
Push — master ( c51e21...61371d )
by Romain
35s
created

DeliveryEvent   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 40
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getDelivery() 0 4 1
A getName() 0 4 1
1
<?php
2
namespace Kerox\Messenger\Event;
3
4
use Kerox\Messenger\Model\Callback\Delivery;
5
6
class DeliveryEvent extends AbstractEvent
7
{
8
9
    const NAME = 'delivery';
10
11
    /**
12
     * @var \Kerox\Messenger\Model\Callback\Delivery
13
     */
14
    protected $delivery;
15
16
    /**
17
     * DeliveryEvent constructor.
18
     *
19
     * @param string $senderId
20
     * @param string $recipientId
21
     * @param \Kerox\Messenger\Model\Callback\Delivery $delivery
22
     */
23 2
    public function __construct(string $senderId, string $recipientId, Delivery $delivery)
24
    {
25 2
        parent::__construct($senderId, $recipientId);
26
27 2
        $this->delivery = $delivery;
28 2
    }
29
30
    /**
31
     * @return \Kerox\Messenger\Model\Callback\Delivery
32
     */
33 1
    public function getDelivery(): Delivery
34
    {
35 1
        return $this->delivery;
36
    }
37
38
    /**
39
     * @return string
40
     */
41 1
    public function getName(): string
42
    {
43 1
        return self::NAME;
44
    }
45
}
46