Completed
Push — master ( ef4a6b...d57726 )
by Arthur
04:47 queued 10s
created

ServerConfig   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 109
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 12
lcom 0
cbo 0
dl 0
loc 109
rs 10
c 0
b 0
f 0

12 Methods

Rating   Name   Duplication   Size   Complexity  
A getClientsPerFork() 0 4 1
A setClientsPerFork() 0 4 1
A getStreamSelectTimeout() 0 4 1
A setStreamSelectTimeout() 0 4 1
A getHost() 0 4 1
A setHost() 0 4 1
A getPort() 0 4 1
A setPort() 0 4 1
A isForking() 0 4 1
A setForking() 0 4 1
A getProcessName() 0 4 1
A setProcessName() 0 4 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
    private $processName = WebSocketServerContract::PROC_TITLE;
19
20
    /**
21
     * @return mixed
22
     */
23
    public function getClientsPerFork(): int
24
    {
25
        return $this->clientsPerFork;
26
    }
27
28
    /**
29
     * @param mixed $clientsPerFork
30
     */
31
    public function setClientsPerFork(int $clientsPerFork)
32
    {
33
        $this->clientsPerFork = $clientsPerFork;
34
    }
35
36
    /**
37
     * @return mixed
38
     */
39
    public function getStreamSelectTimeout(): int
40
    {
41
        return $this->streamSelectTimeout;
42
    }
43
44
    /**
45
     * @param mixed $streamSelectTimeout
46
     */
47
    public function setStreamSelectTimeout(int $streamSelectTimeout)
48
    {
49
        $this->streamSelectTimeout = $streamSelectTimeout;
50
    }
51
52
    /**
53
     * @return string
54
     */
55
    public function getHost(): string
56
    {
57
        return $this->host;
58
    }
59
60
    /**
61
     * @param string $host
62
     */
63
    public function setHost(string $host)
64
    {
65
        $this->host = $host;
66
    }
67
68
    /**
69
     * @return int
70
     */
71
    public function getPort(): int
72
    {
73
        return $this->port;
74
    }
75
76
    /**
77
     * @param int $port
78
     */
79
    public function setPort(int $port)
80
    {
81
        $this->port = $port;
82
    }
83
84
    /**
85
     * @return bool
86
     */
87
    public function isForking(): bool
88
    {
89
        return $this->isForking;
90
    }
91
92
    /**
93
     * @param bool $isForking
94
     */
95
    public function setForking(bool $isForking)
96
    {
97
        $this->isForking = $isForking;
98
    }
99
100
    /**
101
     * @return string
102
     */
103
    public function getProcessName(): string
104
    {
105
        return $this->processName;
106
    }
107
108
    /**
109
     * @param string $processName
110
     */
111
    public function setProcessName(string $processName): void
112
    {
113
        $this->processName = $processName;
114
    }
115
}