Completed
Push — master ( 59b9fb...b4679f )
by Vladimir
02:55
created

SendMessage::getText()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Drivers\Commands;
6
7
use FondBot\Drivers\Chat;
8
use FondBot\Drivers\User;
9
use FondBot\Drivers\Command;
10
use FondBot\Contracts\Template;
11
12
class SendMessage implements Command
13
{
14
    private $chat;
15
    private $recipient;
16
    private $text;
17
    private $template;
18
19 4
    public function __construct(Chat $chat, User $recipient, string $text, Template $template = null)
20
    {
21 4
        $this->chat = $chat;
22 4
        $this->recipient = $recipient;
23 4
        $this->text = $text;
24 4
        $this->template = $template;
25 4
    }
26
27
    /**
28
     * Get name.
29
     *
30
     * @return string
31
     */
32 1
    public function getName(): string
33
    {
34 1
        return 'SendMessage';
35
    }
36
37 1
    public function getChat(): Chat
38
    {
39 1
        return $this->chat;
40
    }
41
42 1
    public function getRecipient(): User
43
    {
44 1
        return $this->recipient;
45
    }
46
47 1
    public function getText(): string
48
    {
49 1
        return $this->text;
50
    }
51
52 1
    public function getTemplate(): ?Template
53
    {
54 1
        return $this->template;
55
    }
56
}
57