Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit 1bb727f

Browse files
committed
Removing higher-order from collection-related tasks
1 parent 3cf74c7 commit 1bb727f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/ChannelManagers/LocalChannelManager.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ public function unsubscribeFromAllChannels(ConnectionInterface $connection): Pro
179179
});
180180

181181
collect($channels)
182-
->reject->hasConnections()
182+
->reject(function ($channel) {
183+
return $channel->hasConnections();
184+
})
183185
->each(function (Channel $channel, string $channelName) use ($connection) {
184186
unset($this->channels[$connection->app->id][$channelName]);
185187
});

src/Channels/Channel.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ public function saveConnection(ConnectionInterface $connection)
156156
public function broadcast($appId, stdClass $payload, bool $replicate = true): bool
157157
{
158158
collect($this->getConnections())
159-
->each->send(json_encode($payload));
159+
->each(function ($connection) use ($payload) {
160+
$connection->send(json_encode($payload));
161+
});
160162

161163
if ($replicate) {
162164
$this->channelManager->broadcastAcrossServers($appId, null, $this->getName(), $payload);

0 commit comments

Comments
 (0)