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

OutgoingMessage   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 45.45%

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 43
ccs 5
cts 11
cp 0.4545
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getRecipient() 0 4 1
A getText() 0 4 1
A getKeyboard() 0 4 1
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