MessageEvent::getRemote()   A
last analyzed

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 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
1
<?php
2
3
/*
4
 * This file is part of PHP DNS Server.
5
 *
6
 * (c) Yif Swery <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace yswery\DNS\Event;
13
14
use React\Datagram\Socket;
15
use React\Datagram\SocketInterface;
16
17
class MessageEvent extends ServerStartEvent
18
{
19
    /**
20
     * @var string
21
     */
22
    private $remote;
23
24
    /**
25
     * @var string
26
     */
27
    private $message;
28
29
    /**
30
     * MessageEvent constructor.
31
     *
32
     * @param SocketInterface $socket
33
     * @param string          $remote
34
     * @param string          $message
35
     */
36 4
    public function __construct(SocketInterface $socket, string $remote, string $message)
37
    {
38 4
        parent::__construct($socket);
39 4
        $this->remote = $remote;
40 4
        $this->message = $message;
41 4
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getRemote(): string
47
    {
48
        return $this->remote;
49
    }
50
51
    /**
52
     * @return string
53
     */
54
    public function getMessage(): string
55
    {
56
        return $this->message;
57
    }
58
}
59