Completed
Push — master ( 88d0e2...efa721 )
by Arthur
01:47
created

ServerConfig::setForking()   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 1
1
<?php
2
3
namespace WSSC\Components;
4
5
use WSSC\Contracts\WebSocketServerContract;
6
7
class ServerConfig
8
{
9
10
    private $clientsPerFork = WebSocketServerContract::CLIENTS_PER_FORK;
11
    private $streamSelectTimeout = WebSocketServerContract::STREAM_SELECT_TIMEOUT;
12
13
    private $host = WebSocketServerContract::DEFAULT_HOST;
14
    private $port = WebSocketServerContract::DEFAULT_PORT;
15
16
    private $isForking = true;
17
18
    /**
19
     * @return mixed
20
     */
21
    public function getClientsPerFork(): int
22
    {
23
        return $this->clientsPerFork;
24
    }
25
26
    /**
27
     * @param mixed $clientsPerFork
28
     */
29
    public function setClientsPerFork(int $clientsPerFork)
30
    {
31
        $this->clientsPerFork = $clientsPerFork;
32
    }
33
34
    /**
35
     * @return mixed
36
     */
37
    public function getStreamSelectTimeout(): int
38
    {
39
        return $this->streamSelectTimeout;
40
    }
41
42
    /**
43
     * @param mixed $streamSelectTimeout
44
     */
45
    public function setStreamSelectTimeout(int $streamSelectTimeout)
46
    {
47
        $this->streamSelectTimeout = $streamSelectTimeout;
48
    }
49
50
    /**
51
     * @return string
52
     */
53
    public function getHost(): string
54
    {
55
        return $this->host;
56
    }
57
58
    /**
59
     * @param string $host
60
     */
61
    public function setHost(string $host)
62
    {
63
        $this->host = $host;
64
    }
65
66
    /**
67
     * @return int
68
     */
69
    public function getPort(): int
70
    {
71
        return $this->port;
72
    }
73
74
    /**
75
     * @param int $port
76
     */
77
    public function setPort(int $port)
78
    {
79
        $this->port = $port;
80
    }
81
82
    /**
83
     * @return bool
84
     */
85
    public function isForking(): bool
86
    {
87
        return $this->isForking;
88
    }
89
90
    /**
91
     * @param bool $isForking
92
     */
93
    public function setForking(bool $isForking)
94
    {
95
        $this->isForking = $isForking;
96
    }
97
}