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

SendMessage   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 45
c 0
b 0
f 0
ccs 16
cts 16
cp 1
rs 10
wmc 6
lcom 0
cbo 0

6 Methods

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