Completed
Push — master ( 41473f...a7f28d )
by Vladimir
02:31
created

MessageReceived::getChat()   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
use Illuminate\Support\Collection;
13
14
class MessageReceived implements Event
15
{
16
    private $chat;
17
    private $from;
18
    private $text;
19
    private $location;
20
    private $attachment;
21
    private $data;
22
    private $additional;
23
24 26
    public function __construct(Chat $chat, User $from, string $text, Location $location = null, Attachment $attachment = null, string $data = null, array $additional = [])
25
    {
26 26
        $this->chat = $chat;
27 26
        $this->from = $from;
28 26
        $this->text = $text;
29 26
        $this->location = $location;
30 26
        $this->attachment = $attachment;
31 26
        $this->data = $data;
32 26
        $this->additional = collect($additional);
33 26
    }
34
35
    public function getChat(): Chat
36
    {
37
        return $this->chat;
38
    }
39
40
    public function getFrom(): User
41
    {
42
        return $this->from;
43
    }
44
45 14
    public function getText(): string
46
    {
47 14
        return $this->text;
48
    }
49
50
    public function getLocation(): Location
51
    {
52
        return $this->location;
53
    }
54
55 10
    public function getAttachment(): ?Attachment
56
    {
57 10
        return $this->attachment;
58
    }
59
60 2
    public function getData(): ?string
61
    {
62 2
        return $this->data;
63
    }
64
65
    public function getAdditional(): Collection
66
    {
67
        return $this->additional;
68
    }
69
70
    public function toResponse($request)
71
    {
72
        // TODO: Implement toResponse() method.
73
    }
74
}
75