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

MessageReceived::getFrom()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
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