1 | <?php |
||
17 | class NetworkServer implements NetworkServerInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var SocketListenerInterface |
||
21 | */ |
||
22 | protected $listener; |
||
23 | |||
24 | /** |
||
25 | * @var SocketServerInterface |
||
26 | */ |
||
27 | protected $server; |
||
28 | |||
29 | /** |
||
30 | * @var HttpServer |
||
31 | */ |
||
32 | protected $http; |
||
33 | |||
34 | /** |
||
35 | * @var SocketFirewall|null |
||
36 | */ |
||
37 | protected $firewall; |
||
38 | |||
39 | /** |
||
40 | * @var HttpRouterInterface |
||
41 | */ |
||
42 | public $router; |
||
43 | |||
44 | /** |
||
45 | * @param SocketListenerInterface $listener |
||
46 | * @param mixed[] $params |
||
47 | * @throws InstantiationException |
||
48 | */ |
||
49 | 20 | public function __construct(SocketListenerInterface $listener, $params = []) |
|
75 | |||
76 | /** |
||
77 | * |
||
78 | */ |
||
79 | 1 | public function __destruct() |
|
80 | { |
||
81 | 1 | unset($this->router); |
|
82 | 1 | unset($this->firewall); |
|
83 | 1 | unset($this->http); |
|
84 | 1 | unset($this->server); |
|
85 | 1 | unset($this->listener); |
|
86 | 1 | } |
|
87 | |||
88 | /** |
||
89 | * @override |
||
90 | * @inheritDoc |
||
91 | */ |
||
92 | 1 | public function existsRoute($path) |
|
96 | |||
97 | /** |
||
98 | * @override |
||
99 | * @inheritDoc |
||
100 | */ |
||
101 | 2 | public function addRoute($path, NetworkComponentInterface $component) |
|
105 | |||
106 | /** |
||
107 | * @override |
||
108 | * @inheritDoc |
||
109 | */ |
||
110 | 1 | public function removeRoute($path) |
|
114 | |||
115 | /** |
||
116 | * @override |
||
117 | * @inheritDoc |
||
118 | */ |
||
119 | 1 | public function blockAddress($address) |
|
130 | |||
131 | /** |
||
132 | * @override |
||
133 | * @inheritDoc |
||
134 | */ |
||
135 | 1 | public function unblockAddress($address) |
|
146 | |||
147 | /** |
||
148 | * @override |
||
149 | * @inheritDoc |
||
150 | */ |
||
151 | 2 | public function isAddressBlocked($address) |
|
160 | |||
161 | /** |
||
162 | * @override |
||
163 | * @inheritDoc |
||
164 | */ |
||
165 | 2 | public function getBlockedAddresses() |
|
174 | |||
175 | /** |
||
176 | * @override |
||
177 | * @inheritDoc |
||
178 | */ |
||
179 | 1 | public function stop() |
|
183 | |||
184 | /** |
||
185 | * @override |
||
186 | * @inheritDoc |
||
187 | */ |
||
188 | 1 | public function close() |
|
192 | |||
193 | /** |
||
194 | * @override |
||
195 | * @inheritDoc |
||
196 | */ |
||
197 | 1 | public function getLoop() |
|
201 | |||
202 | /** |
||
203 | * @override |
||
204 | * @inheritDoc |
||
205 | */ |
||
206 | 1 | public function setLoop(LoopInterface $loop = null) |
|
210 | |||
211 | /** |
||
212 | * @override |
||
213 | * @inheritDoc |
||
214 | */ |
||
215 | 1 | public function isPaused() |
|
219 | |||
220 | /** |
||
221 | * @override |
||
222 | * @inheritDoc |
||
223 | */ |
||
224 | 1 | public function pause() |
|
228 | |||
229 | /** |
||
230 | * @override |
||
231 | * @inheritDoc |
||
232 | */ |
||
233 | 1 | public function resume() |
|
237 | |||
238 | /** |
||
239 | * Create and attach firewall to transfer server Firewall. |
||
240 | */ |
||
241 | 1 | protected function createFirewall() |
|
245 | } |
||
246 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: