Passed
Push — master ( 350d73...c9415f )
by Vladimir
02:02
created

MessageReceived::getRaw()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
ccs 0
cts 1
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
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\Templates\Location;
10
use FondBot\Templates\Attachment;
11
12
class MessageReceived extends Event
13
{
14
    private $chat;
15
    private $from;
16
    private $text;
17
    private $location;
18
    private $attachment;
19
    private $data;
20
    private $raw;
21
22
    public function __construct(
23
        Chat $chat,
24 27
        User $from,
25
        string $text,
26 27
        Location $location = null,
27 27
        Attachment $attachment = null,
28 27
        string $data = null,
29 27
        $raw = null
30 27
    ) {
31 27
        $this->chat = $chat;
32 27
        $this->from = $from;
33 27
        $this->text = $text;
34
        $this->location = $location;
35
        $this->attachment = $attachment;
36
        $this->data = $data;
37
        $this->raw = $raw;
38
    }
39
40
    public function getChat(): Chat
41
    {
42
        return $this->chat;
43
    }
44
45 15
    public function getFrom(): User
46
    {
47 15
        return $this->from;
48
    }
49
50
    public function getText(): string
51
    {
52
        return $this->text;
53
    }
54
55 10
    public function getLocation(): Location
56
    {
57 10
        return $this->location;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->location could return the type null which is incompatible with the type-hinted return FondBot\Templates\Location. Consider adding an additional type-check to rule them out.
Loading history...
58
    }
59
60 2
    public function getAttachment(): ?Attachment
61
    {
62 2
        return $this->attachment;
63
    }
64
65
    public function getData(): ?string
66
    {
67
        return $this->data;
68
    }
69
70
    public function getRaw()
71
    {
72
        return $this->raw;
73
    }
74
}
75