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

MessageReceived   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
dl 0
loc 40
c 0
b 0
f 0
ccs 12
cts 16
cp 0.75
rs 10
wmc 6
lcom 0
cbo 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 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\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