public function onClose(WebSocketConnection $connection) { if ($this->isSubscribed($connection)) { $this->unsubscribe($connection); } $this->connections = $this->connections->filter(function ($c) use($connection) { return $c !== $connection; }); }
public function removeConnection(WebSocketConnection $connection) { $this->connections = $this->connections->filter(function ($c) use($connection) { return $c !== $connection; }); }