Passed
Push — master ( 98541d...d359a0 )
by
unknown
08:18
created

MessageReceived::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 4
ccs 6
cts 6
cp 1
crap 1
rs 9.4285
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Events;
6
7
use FondBot\Contracts\Event;
8
use FondBot\Templates\Location;
9
use FondBot\Templates\Attachment;
10
11
class MessageReceived implements Event
12
{
13
    private $text;
14
    private $location;
15
    private $attachment;
16
    private $data;
17
18 26
    public function __construct(string $text, Location $location = null, Attachment $attachment = null, string $data = null)
19
    {
20 26
        $this->text = $text;
21 26
        $this->location = $location;
22 26
        $this->attachment = $attachment;
23 26
        $this->data = $data;
24 26
    }
25
26 14
    public function getText(): string
27
    {
28 14
        return $this->text;
29
    }
30
31
    public function getLocation(): Location
32
    {
33
        return $this->location;
34
    }
35
36 10
    public function getAttachment(): ?Attachment
37
    {
38 10
        return $this->attachment;
39
    }
40
41 2
    public function getData(): ?string
42
    {
43 2
        return $this->data;
44
    }
45
46
    public function toResponse($request)
47
    {
48
        // TODO: Implement toResponse() method.
49
    }
50
}
51