Fixed some phpstan errors
This commit is contained in:
parent
7154b1baed
commit
cb458cbebb
@ -46,11 +46,19 @@ class ConnectionGroup implements EventEmitterInterface, IteratorAggregate, Count
|
|||||||
return count($this->connections);
|
return count($this->connections);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return \Traversable<int,WebSocketInterface>
|
||||||
|
*/
|
||||||
public function getIterator(): Traversable
|
public function getIterator(): Traversable
|
||||||
{
|
{
|
||||||
return new ArrayIterator($this->connections);
|
return new ArrayIterator($this->connections);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return WebSocketInterface[]
|
||||||
|
*/
|
||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
return $this->connections;
|
return $this->connections;
|
||||||
@ -70,6 +78,10 @@ class ConnectionGroup implements EventEmitterInterface, IteratorAggregate, Count
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function closeAll(string $reason, int $code=1001)
|
public function closeAll(string $reason, int $code=1001)
|
||||||
{
|
{
|
||||||
foreach ($this->connections as $connection) {
|
foreach ($this->connections as $connection) {
|
||||||
|
@ -64,7 +64,8 @@ class WebSocketMiddleware implements EventEmitterInterface
|
|||||||
$this->emit(self::EVENT_CONNECTION, [ $websocket ]);
|
$this->emit(self::EVENT_CONNECTION, [ $websocket ]);
|
||||||
//});
|
//});
|
||||||
|
|
||||||
// TODO would it be possible or rather useful for the 'connection' event to set additional response headers to be sent here?
|
// TODO would it be possible for the 'connection' event to set additional response headers to be sent here?
|
||||||
|
// For example, to send back Sec-WebSocket-Protocol header.
|
||||||
return new Response(
|
return new Response(
|
||||||
Response::STATUS_SWITCHING_PROTOCOLS,
|
Response::STATUS_SWITCHING_PROTOCOLS,
|
||||||
array(
|
array(
|
||||||
|
@ -111,7 +111,7 @@ class WebSocketProtocol
|
|||||||
* payload (string) - the payload
|
* payload (string) - the payload
|
||||||
*
|
*
|
||||||
* @param string $frame The frame data to decode
|
* @param string $frame The frame data to decode
|
||||||
* @return array The decoded frame
|
* @return array<string,mixed> The decoded frame
|
||||||
*/
|
*/
|
||||||
public function decode(string $frame): array
|
public function decode(string $frame): array
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user