Server::getPort()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
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 12
    public function __construct(string $host, ?int $port, int $timeout)
22
    {
23 12
        $this->host = $host;
24 12
        $this->port = $port;
25 12
        $this->timeout = $timeout;
26 12
    }
27
28 12
    public function getHost(): string
29
    {
30 12
        return $this->host;
31
    }
32
33 12
    public function getPort(): ?int
34
    {
35 12
        return $this->port;
36
    }
37
38 12
    public function getTimeout(): int
39
    {
40 12
        return $this->timeout;
41
    }
42
}
43