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

SendRequest   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 getEndpoint() 0 4 1
A getParameters() 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
11
class SendRequest implements Command
12
{
13
    private $chat;
14
    private $recipient;
15
    private $endpoint;
16
    private $parameters;
17
18 2
    public function __construct(Chat $chat, User $recipient, string $endpoint, array $parameters = [])
19
    {
20 2
        $this->chat = $chat;
21 2
        $this->recipient = $recipient;
22 2
        $this->endpoint = $endpoint;
23 2
        $this->parameters = $parameters;
24 2
    }
25
26
    /**
27
     * Get name.
28
     *
29
     * @return string
30
     */
31 1
    public function getName(): string
32
    {
33 1
        return 'SendRequest';
34
    }
35
36 1
    public function getChat(): Chat
37
    {
38 1
        return $this->chat;
39
    }
40
41 1
    public function getRecipient(): User
42
    {
43 1
        return $this->recipient;
44
    }
45
46 1
    public function getEndpoint(): string
47
    {
48 1
        return $this->endpoint;
49
    }
50
51 1
    public function getParameters(): array
52
    {
53 1
        return $this->parameters;
54
    }
55
}
56