MessageEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 55.56%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 40
ccs 5
cts 9
cp 0.5556
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getRemote() 0 3 1
A __construct() 0 5 1
A getMessage() 0 3 1
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