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

SendAttachment   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 38
c 0
b 0
f 0
ccs 13
cts 13
cp 1
rs 10
wmc 5
lcom 0
cbo 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getName() 0 4 1
A getChat() 0 4 1
A getRecipient() 0 4 1
A getAttachment() 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\Templates\Attachment;
11
12
class SendAttachment implements Command
13
{
14
    private $chat;
15
    private $recipient;
16
    private $attachment;
17
18 3
    public function __construct(Chat $chat, User $recipient, Attachment $attachment)
19
    {
20 3
        $this->chat = $chat;
21 3
        $this->recipient = $recipient;
22 3
        $this->attachment = $attachment;
23 3
    }
24
25
    /**
26
     * Get name.
27
     *
28
     * @return string
29
     */
30 1
    public function getName(): string
31
    {
32 1
        return 'SendAttachment';
33
    }
34
35 1
    public function getChat(): Chat
36
    {
37 1
        return $this->chat;
38
    }
39
40 1
    public function getRecipient(): User
41
    {
42 1
        return $this->recipient;
43
    }
44
45 1
    public function getAttachment(): Attachment
46
    {
47 1
        return $this->attachment;
48
    }
49
}
50