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

Commit 3f8bb62

Browse files
committed
Enforce stdclass typehint
1 parent 8e3a86d commit 3f8bb62

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/HttpApi/Controllers/TriggerEventController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function __invoke(Request $request)
2121
foreach ($request->json()->get('channels', []) as $channelName) {
2222
$channel = $this->channelManager->find($request->appId, $channelName);
2323

24-
optional($channel)->broadcastToEveryoneExcept([
24+
optional($channel)->broadcastToEveryoneExcept((object) [
2525
'channel' => $channelName,
2626
'event' => $request->json()->get('name'),
2727
'data' => $request->json()->get('data'),

src/WebSockets/Channels/Channel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public function broadcast($payload)
182182
* @param \stdClass $payload
183183
* @return void
184184
*/
185-
public function broadcastToOthers(ConnectionInterface $connection, $payload)
185+
public function broadcastToOthers(ConnectionInterface $connection, stdClass $payload)
186186
{
187187
$this->broadcastToEveryoneExcept(
188188
$payload, $connection->socketId, $connection->app->id
@@ -198,7 +198,7 @@ public function broadcastToOthers(ConnectionInterface $connection, $payload)
198198
* @param bool $publish
199199
* @return void
200200
*/
201-
public function broadcastToEveryoneExcept($payload, ?string $socketId, $appId, bool $publish = true)
201+
public function broadcastToEveryoneExcept(stdClass $payload, ?string $socketId, $appId, bool $publish = true)
202202
{
203203
// Also broadcast via the other websocket server instances.
204204
// This is set false in the Redis client because we don't want to cause a loop

0 commit comments

Comments
 (0)