From 491d0c779ce10da60c0d6e11aa6aa03fae30db92 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Sun, 22 Jul 2012 20:00:25 -0400 Subject: [PATCH] [WAMP] Removed default var from onPublish Removed default array being set on WampServerInterface::onPublish These methods are called by Ratchet's event components Ratchet will never pass null values This removes excess requirements from the end developer --- src/Ratchet/Wamp/TopicManager.php | 2 +- src/Ratchet/Wamp/WampServerInterface.php | 2 +- tests/Ratchet/Tests/Wamp/TopicManagerTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Ratchet/Wamp/TopicManager.php b/src/Ratchet/Wamp/TopicManager.php index b019371..6020791 100644 --- a/src/Ratchet/Wamp/TopicManager.php +++ b/src/Ratchet/Wamp/TopicManager.php @@ -67,7 +67,7 @@ class TopicManager implements WsServerInterface, WampServerInterface { /** * {@inheritdoc} */ - public function onPublish(ConnectionInterface $conn, $topic, $event, array $exclude = array(), array $eligible = array()) { + public function onPublish(ConnectionInterface $conn, $topic, $event, array $exclude, array $eligible) { $this->app->onPublish($conn, $this->getTopic($topic), $event, $exclude, $eligible); } diff --git a/src/Ratchet/Wamp/WampServerInterface.php b/src/Ratchet/Wamp/WampServerInterface.php index 0269e06..55aca4c 100644 --- a/src/Ratchet/Wamp/WampServerInterface.php +++ b/src/Ratchet/Wamp/WampServerInterface.php @@ -39,5 +39,5 @@ interface WampServerInterface extends ComponentInterface { * @param array A list of session IDs the message should be excluded from (blacklist) * @param array A list of session Ids the message should be send to (whitelist) */ - function onPublish(ConnectionInterface $conn, $topic, $event, array $exclude = array(), array $eligible = array()); + function onPublish(ConnectionInterface $conn, $topic, $event, array $exclude, array $eligible); } \ No newline at end of file diff --git a/tests/Ratchet/Tests/Wamp/TopicManagerTest.php b/tests/Ratchet/Tests/Wamp/TopicManagerTest.php index 0a6655b..8388550 100644 --- a/tests/Ratchet/Tests/Wamp/TopicManagerTest.php +++ b/tests/Ratchet/Tests/Wamp/TopicManagerTest.php @@ -144,7 +144,7 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase { , $this->isType('array') ); - $this->mngr->onPublish($this->conn, 'topic coverage', $msg); + $this->mngr->onPublish($this->conn, 'topic coverage', $msg, array(), array()); } public function testOnCloseBubbles() {