Completed
Push — master ( 17cc82...87aff1 )
by Vladimir
04:11
created

OutgoingMessage::getKeyboard()   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
c 0
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Drivers;
6
7
use FondBot\Conversation\Keyboard;
8
9
/**
10
 * Message to be sent to receiver.
11
 */
12
class OutgoingMessage
13
{
14
    private $recipient;
15
    private $text;
16
    private $keyboard;
17
18 1
    public function __construct(User $recipient, string $text, Keyboard $keyboard = null)
19
    {
20 1
        $this->recipient = $recipient;
21 1
        $this->text = $text;
22 1
        $this->keyboard = $keyboard;
23 1
    }
24
25
    /**
26
     * Get recipient.
27
     *
28
     * @return User
29
     */
30
    public function getRecipient(): User
31
    {
32
        return $this->recipient;
33
    }
34
35
    /**
36
     * Get message text.
37
     *
38
     * @return string
39
     */
40
    public function getText(): string
41
    {
42
        return $this->text;
43
    }
44
45
    /**
46
     * Get keyboard.
47
     *
48
     * @return Keyboard|null
49
     */
50
    public function getKeyboard(): ?Keyboard
51
    {
52
        return $this->keyboard;
53
    }
54
}
55