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

Server   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 33
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
    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