Completed
Pull Request — master (#17)
by Romain
03:33
created

CheckoutUpdateEvent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 55
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getTimestamp() 0 4 1
A getCheckoutUpdate() 0 4 1
A getName() 0 4 1
1
<?php
2
namespace Kerox\Messenger\Event;
3
4
use Kerox\Messenger\Model\Callback\CheckoutUpdate;
5
6
class CheckoutUpdateEvent extends AbstractEvent
7
{
8
9
    const NAME = 'checkout_update';
10
11
    /**
12
     * @var int
13
     */
14
    protected $timestamp;
15
16
    /**
17
     * @var \Kerox\Messenger\Model\Callback\CheckoutUpdate
18
     */
19
    protected $checkoutUpdate;
20
21
    /**
22
     * CheckoutUpdateEvent constructor.
23
     *
24
     * @param string $senderId
25
     * @param string $recipientId
26
     * @param int $timestamp
27
     * @param \Kerox\Messenger\Model\Callback\CheckoutUpdate $checkoutUpdate
28
     */
29 2
    public function __construct(string $senderId, string $recipientId, int $timestamp, CheckoutUpdate $checkoutUpdate)
30
    {
31 2
        parent::__construct($senderId, $recipientId);
32
33 2
        $this->timestamp = $timestamp;
34 2
        $this->checkoutUpdate = $checkoutUpdate;
35 2
    }
36
37
    /**
38
     * @return int
39
     */
40 1
    public function getTimestamp(): int
41
    {
42 1
        return $this->timestamp;
43
    }
44
45
    /**
46
     * @return \Kerox\Messenger\Model\Callback\CheckoutUpdate
47
     */
48 1
    public function getCheckoutUpdate(): CheckoutUpdate
49
    {
50 1
        return $this->checkoutUpdate;
51
    }
52
53
    /**
54
     * @return string
55
     */
56 1
    public function getName(): string
57
    {
58 1
        return self::NAME;
59
    }
60
}