Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove subscriber reference from topic when deleted #1288

Merged
merged 20 commits into from
Apr 15, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clarify variable names
  • Loading branch information
spawnia committed Apr 14, 2020
commit 7dc3afa01d311b5df355ab905d95f2c0701943a2
6 changes: 3 additions & 3 deletions src/Subscriptions/StorageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ protected function addSubscriberToTopic(Subscriber $subscriber): void
protected function removeSubscriberFromTopic(Subscriber $subscriber)
{
$topicKey = self::topicKey($subscriber->topic);
$channelKey = self::channelKey($subscriber->channel);
$channelKeyToRemove = self::channelKey($subscriber->channel);

$topicWithoutSubscriber = $this
->retrieveTopic($topicKey)
->reject(function (string $key) use ($channelKey): bool {
return self::channelKey($key) === $channelKey;
->reject(function (string $channel) use ($channelKeyToRemove): bool {
return self::channelKey($channel) === $channelKeyToRemove;
});

if ($topicWithoutSubscriber->isEmpty()) {
Expand Down