diff --git a/lib/Ratchet/Application/WAMP/App.php b/lib/Ratchet/Application/WAMP/App.php index 5d4e67d..cf31c92 100644 --- a/lib/Ratchet/Application/WAMP/App.php +++ b/lib/Ratchet/Application/WAMP/App.php @@ -65,8 +65,14 @@ class App implements WebSocketAppInterface { case 2: array_shift($json); - array_unshift($json, $from); - return call_user_func_array(array($this->_app, 'onCall'), $json); + $callID = array_shift($json); + $procURI = array_shift($json); + + if (count($json) == 1 && is_array($json[0])) { + $json = $json[0]; + } + + return $this->_app->onCall($from, $callID, $procURI, $json); break; case 5: @@ -93,7 +99,7 @@ class App implements WebSocketAppInterface { * @return string */ protected function getUri(Connection $conn, $uri) { - $ret = (isset($conn->WAMP->prefixes[$uri]) ? $conn->WAMP->prefixes[$uri] : $uri); + return (isset($conn->WAMP->prefixes[$uri]) ? $conn->WAMP->prefixes[$uri] : $uri); } public function __construct(ServerInterface $app) { diff --git a/lib/Ratchet/Application/WAMP/Command/Action/Event.php b/lib/Ratchet/Application/WAMP/Command/Action/Event.php index 77bc270..fac4428 100644 --- a/lib/Ratchet/Application/WAMP/Command/Action/Event.php +++ b/lib/Ratchet/Application/WAMP/Command/Action/Event.php @@ -10,6 +10,7 @@ class Event extends SendMessage { /** * @param ... * @param string + * @return Event */ public function setEvent($uri, $msg) { return $this->setMessage(json_encode(array(8, $uri, (string)$msg))); diff --git a/lib/Ratchet/Application/WAMP/ServerInterface.php b/lib/Ratchet/Application/WAMP/ServerInterface.php index b636f2d..f072181 100644 --- a/lib/Ratchet/Application/WAMP/ServerInterface.php +++ b/lib/Ratchet/Application/WAMP/ServerInterface.php @@ -33,9 +33,10 @@ interface ServerInterface { * @param Ratchet\Resource\Connection * @param string * @param ... + * @param array Call parameters received from the client * @return Ratchet\Resource\Command\CommandInterface|null */ - function onCall(); + function onCall(Connection $conn, $id, $procURI, array $params); /** * A request to subscribe to a URI has been made