
Server accepts single Observable object (was Chain of Responsibility) WebSocket is decorator of application implementing Observable Observable interface returns Command pattern object Interfaced all the things Code is a mess Unit tests are broken
15 lines
319 B
PHP
15 lines
319 B
PHP
<?php
|
|
namespace Ratchet\Server\Command;
|
|
use Ratchet\SocketCollection;
|
|
|
|
class CloseConnection implements CommandInterface {
|
|
protected $_sockets;
|
|
|
|
public function __construct(SocketCollection $sockets) {
|
|
$this->_sockets = $sockets;
|
|
}
|
|
|
|
function execute() {
|
|
$this->_sockets->close();
|
|
}
|
|
} |