Completed
Pull Request — master (#12)
by Romain
06:58
created

PaymentEvent::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
namespace Kerox\Messenger\Event;
3
4
use Kerox\Messenger\Model\Callback\Payment;
5
6
class PaymentEvent extends AbstractEvent
7
{
8
9
    const NAME = 'payment';
10
11
    /**
12
     * @var int
13
     */
14
    protected $timestamp;
15
16
    /**
17
     * @var \Kerox\Messenger\Model\Callback\Payment
18
     */
19
    protected $payment;
20
21
    /**
22
     * PaymentEvent constructor.
23
     *
24
     * @param string $senderId
25
     * @param string $recipientId
26
     * @param int $timestamp
27
     * @param \Kerox\Messenger\Model\Callback\Payment $payment
28
     */
29 1
    public function __construct(string $senderId, string $recipientId, int $timestamp, Payment $payment)
30
    {
31 1
        parent::__construct($senderId, $recipientId);
32
33 1
        $this->timestamp = $timestamp;
34 1
        $this->payment = $payment;
35 1
    }
36
37
    /**
38
     * @return int
39
     */
40
    public function getTimestamp(): int
41
    {
42
        return $this->timestamp;
43
    }
44
45
    /**
46
     * @return \Kerox\Messenger\Model\Callback\Payment
47
     */
48
    public function getPayment(): Payment
49
    {
50
        return $this->payment;
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function getName(): string
57
    {
58
        return self::NAME;
59
    }
60
}
61