Server   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 33
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getHost() 0 4 1
A getPort() 0 4 1
A getTimeout() 0 4 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