Completed
Pull Request — master (#40)
by
unknown
08:46
created

Server::getHost()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace BeyondCode\SelfDiagnosis;
4
5
/**
6
 * DTO class for a server used by the ping check.
7
 *
8
 * @package BeyondCode\SelfDiagnosis
9
 */
10
class Server
11
{
12
    /** @var string */
13
    protected $host;
14
15
    /** @var int|null */
16
    protected $port;
17
18
    /** @var int */
19
    protected $timeout;
20
21
    public function __construct(string $host, ?int $port, int $timeout)
22
    {
23
        $this->host = $host;
24
        $this->port = $port;
25
        $this->timeout = $timeout;
26
    }
27
28
    public function getHost(): string
29
    {
30
        return $this->host;
31
    }
32
33
    public function getPort(): ?int
34
    {
35
        return $this->port;
36
    }
37
38
    public function getTimeout(): int
39
    {
40
        return $this->timeout;
41
    }
42
}
43