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

Commit 75c46e1

Browse files
committed
Undo changes must be the redist broadcaster
1 parent 1cd35b1 commit 75c46e1

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/PubSub/Drivers/LocalClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ public function boot(LoopInterface $loop, $factoryClass = null): ReplicationInte
3434
*
3535
* @param string $appId
3636
* @param string $channel
37-
* @param array $payload
37+
* @param stdClass $payload
3838
* @return bool
3939
*/
40-
public function publish($appId, string $channel, array $payload): bool
40+
public function publish($appId, string $channel, stdClass $payload): bool
4141
{
4242
return true;
4343
}

src/PubSub/Drivers/RedisClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ public function boot(LoopInterface $loop, $factoryClass = null): ReplicationInte
9494
*
9595
* @param string $appId
9696
* @param string $channel
97-
* @param array $payload
97+
* @param stdClass $payload
9898
* @return bool
9999
*/
100-
public function publish($appId, string $channel, array $payload): bool
100+
public function publish($appId, string $channel, stdClass $payload): bool
101101
{
102102
$payload->appId = $appId;
103103
$payload->serverId = $this->getServerId();

src/PubSub/ReplicationInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ public function boot(LoopInterface $loop, $factoryClass = null): self;
2222
*
2323
* @param string $appId
2424
* @param string $channel
25-
* @param array $payload
25+
* @param stdClass $payload
2626
* @return bool
2727
*/
28-
public function publish($appId, string $channel, array $payload): bool;
28+
public function publish($appId, string $channel, stdClass $payload): bool;
2929

3030
/**
3131
* Subscribe to receive messages for a channel.

tests/PubSub/RedisDriverTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ public function redis_listener_responds_properly_on_payload()
3030
],
3131
];
3232

33-
$payload = [
33+
$payload = json_encode([
3434
'appId' => '1234',
3535
'event' => 'test',
3636
'data' => $channelData,
3737
'socket' => $connection->socketId,
38-
];
38+
]);
3939

4040
$this->getSubscribeClient()->onMessage('1234:test-channel', $payload);
4141

0 commit comments

Comments
 (0)