From 2b9e4a4aee42f5ded574e2f853fa3674dc995e07 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Fri, 15 Jun 2012 09:56:16 -0400 Subject: [PATCH] CS --- WsServer.php | 28 +++++++++++++++++----------- WsServerInterface.php | 2 +- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/WsServer.php b/WsServer.php index efdabfc..2e44a8c 100644 --- a/WsServer.php +++ b/WsServer.php @@ -22,8 +22,9 @@ class WsServer implements MessageComponentInterface { /** * Manage the various WebSocket versions to support * @var VersionManager + * @note May not expose this in the future, may do through facade methods */ - protected $versioner; + public $versioner; /** * Decorated component @@ -149,16 +150,6 @@ class WsServer implements MessageComponentInterface { } } - protected function close(ConnectionInterface $conn, $code = 400) { - $response = new Response($code, array( - 'Sec-WebSocket-Version' => $this->versioner->getSupportedVersionString() - , 'X-Powered-By' => \Ratchet\VERSION - )); - - $conn->send((string)$response); - $conn->close(); - } - /** * @param string * @return boolean @@ -194,4 +185,19 @@ class WsServer implements MessageComponentInterface { return substr($string, 0, -1); } + + /** + * Close a connection with an HTTP response + * @param Ratchet\ConnectionInterface + * @param int HTTP status code + */ + protected function close(ConnectionInterface $conn, $code = 400) { + $response = new Response($code, array( + 'Sec-WebSocket-Version' => $this->versioner->getSupportedVersionString() + , 'X-Powered-By' => \Ratchet\VERSION + )); + + $conn->send((string)$response); + $conn->close(); + } } \ No newline at end of file diff --git a/WsServerInterface.php b/WsServerInterface.php index 8cb378d..91a83cd 100644 --- a/WsServerInterface.php +++ b/WsServerInterface.php @@ -5,7 +5,7 @@ interface WsServerInterface { /** * If any component in a stack supports a WebSocket sub-protocol return each supported in an array * @return array - * @temporary This method may be removed in future version (note tha twill not break code, just make some code obsolete) + * @temporary This method may be removed in future version (note that will not break code, just make some code obsolete) */ function getSubProtocols(); } \ No newline at end of file