Skip to content

Commit

Permalink
[WAMP][BCB] Property name change
Browse files Browse the repository at this point in the history
Changed $conn->WAMP->topics to
$conn->WAMP->subscriptions
  • Loading branch information
cboden committed Jul 22, 2012
1 parent 226ec07 commit 6ee8107
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/Ratchet/Wamp/TopicManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(WampServerInterface $app) {
* {@inheritdoc}
*/
public function onOpen(ConnectionInterface $conn) {
$conn->WAMP->topics = new \SplObjectStorage;
$conn->WAMP->subscriptions = new \SplObjectStorage;
$this->app->onOpen($conn);
}

Expand All @@ -39,12 +39,12 @@ public function onCall(ConnectionInterface $conn, $id, $topic, array $params) {
public function onSubscribe(ConnectionInterface $conn, $topic) {
$topicObj = $this->getTopic($topic);

if ($conn->WAMP->topics->contains($topicObj)) {
if ($conn->WAMP->subscriptions->contains($topicObj)) {
return;
}

$this->topicLookup[$topic]->add($conn);
$conn->WAMP->topics->attach($topicObj);
$conn->WAMP->subscriptions->attach($topicObj);
$this->app->onSubscribe($conn, $topicObj);
}

Expand All @@ -54,8 +54,8 @@ public function onSubscribe(ConnectionInterface $conn, $topic) {
public function onUnsubscribe(ConnectionInterface $conn, $topic) {
$topicObj = $this->getTopic($topic);

if ($conn->WAMP->topics->contains($topicObj)) {
$conn->WAMP->topics->detach($topicObj);
if ($conn->WAMP->subscriptions->contains($topicObj)) {
$conn->WAMP->subscriptions->detach($topicObj);
} else {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Ratchet/Tests/Wamp/TopicManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function testTopicIsInConnectionOnSubscribe() {

$this->mngr->onSubscribe($this->conn, $name);

$this->assertTrue($this->conn->WAMP->topics->contains($topic));
$this->assertTrue($this->conn->WAMP->subscriptions->contains($topic));
}

public function testDoubleSubscriptionFiresOnce() {
Expand Down Expand Up @@ -130,7 +130,7 @@ public function testUnsubscribeRemovesTopicFromConnection() {
$this->mngr->onSubscribe($this->conn, $name);
$this->mngr->onUnsubscribe($this->conn, $name);

$this->assertFalse($this->conn->WAMP->topics->contains($topic));
$this->assertFalse($this->conn->WAMP->subscriptions->contains($topic));
}

public function testOnPublishBubbles() {
Expand Down

0 comments on commit 6ee8107

Please sign in to comment.