Completed
Push — master ( 16b7cb...b112db )
by Vladimir
07:44
created

MessageReceived   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 63.64%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 54
ccs 14
cts 22
cp 0.6364
rs 10
c 1
b 0
f 0
wmc 8
lcom 0
cbo 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A getChat() 0 4 1
A getFrom() 0 4 1
A getText() 0 4 1
A getLocation() 0 4 1
A getAttachment() 0 4 1
A getData() 0 4 1
A toResponse() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Events;
6
7
use FondBot\Channels\Chat;
8
use FondBot\Channels\User;
9
use FondBot\Contracts\Event;
10
use FondBot\Templates\Location;
11
use FondBot\Templates\Attachment;
12
13
class MessageReceived implements Event
14
{
15
    private $chat;
16
    private $from;
17
    private $text;
18
    private $location;
19
    private $attachment;
20
    private $data;
21
22 26
    public function __construct(Chat $chat, User $from, string $text, Location $location = null, Attachment $attachment = null, string $data = null)
23
    {
24 26
        $this->chat = $chat;
25 26
        $this->from = $from;
26 26
        $this->text = $text;
27 26
        $this->location = $location;
28 26
        $this->attachment = $attachment;
29 26
        $this->data = $data;
30 26
    }
31
32
    public function getChat(): Chat
33
    {
34
        return $this->chat;
35
    }
36
37
    public function getFrom(): User
38
    {
39
        return $this->from;
40
    }
41
42 14
    public function getText(): string
43
    {
44 14
        return $this->text;
45
    }
46
47
    public function getLocation(): Location
48
    {
49
        return $this->location;
50
    }
51
52 10
    public function getAttachment(): ?Attachment
53
    {
54 10
        return $this->attachment;
55
    }
56
57 2
    public function getData(): ?string
58
    {
59 2
        return $this->data;
60
    }
61
62
    public function toResponse($request)
63
    {
64
        // TODO: Implement toResponse() method.
65
    }
66
}
67