Passed
Push — develop ( 065f10...1d4e29 )
by Aleksandr
01:25
created

BuilderConfigurator::setup()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 5
dl 0
loc 16
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace AlexCool\Rcon\Configurator;
4
5
/**
6
 * @author Aleksandr Kulina <[email protected]>
7
 *
8
 * @package AlexCool\Rcon\Server\Minecraft
9
 */
10
final class BuilderConfigurator
11
{
12
    /**
13
     * @var string
14
     */
15
    private $host;
16
17
    /**
18
     * @var int
19
     */
20
    private $serverPort;
21
22
    /**
23
     * @var int
24
     */
25
    private $rconPort;
26
27
    /**
28
     * @var string
29
     */
30
    private $rconPassword;
31
32
    /**
33
     * @var float
34
     */
35
    private $rconTimeout;
36
37
    /**
38
     * @param string $host
39
     * @param int $serverPort
40
     * @param int $rconPort
41
     * @param string $rconPassword
42
     * @param float $rconTimeout
43
     *
44
     * @return BuilderConfigurator
45
     */
46
    public static function setup(
47
        string $host,
48
        int $serverPort,
49
        int $rconPort,
50
        string $rconPassword,
51
        float $rconTimeout
52
    ) {
53
        $self = new static();
54
55
        $self->host = $host;
56
        $self->serverPort = $serverPort;
57
        $self->rconPort = $rconPort;
58
        $self->rconPassword = $rconPassword;
59
        $self->rconTimeout = $rconTimeout;
60
61
        return $self;
62
    }
63
64
    /**
65
     * @return string
66
     */
67
    public function getHost(): string
68
    {
69
        return $this->host;
70
    }
71
72
    /**
73
     * @return int
74
     */
75
    public function getServerPort(): int
76
    {
77
        return $this->serverPort;
78
    }
79
80
    /**
81
     * @return int
82
     */
83
    public function getRconPort(): int
84
    {
85
        return $this->rconPort;
86
    }
87
88
    /**
89
     * @return string
90
     */
91
    public function getRconPassword(): string
92
    {
93
        return $this->rconPassword;
94
    }
95
96
    /**
97
     * @return float
98
     */
99
    public function getRconTimeout(): float
100
    {
101
        return $this->rconTimeout;
102
    }
103
}
104