Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Client/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* @author Pierre Rolland <roll.pierre@gmail.com>
*/
class Client
class Client implements ClientInterface
{
/** @var ConnectionInterface */
protected $connection;
Expand Down
5 changes: 5 additions & 0 deletions Client/ClientStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public function removeClient(ConnectionInterface $connection)
unset($this->clients[$this->getClientIndex($connection)]);
}

public function getClients(): array
{
return $this->clients;
}

private function getClientIndex(ConnectionInterface $connection): int
{
foreach ($this->clients as $i => $c) {
Expand Down
2 changes: 1 addition & 1 deletion Websocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(HandlerRegistry $handlerRegistry, string $clientClas

public function onOpen(ConnectionInterface $conn)
{
$this->clientStack->addClient(new ${$this->clientClass}($conn));
$this->clientStack->addClient(new $this->clientClass($conn));
}

public function onMessage(ConnectionInterface $from, $msg)
Expand Down