Skip to content

Commit 2faadcd

Browse files
committed
formatting
1 parent 8597486 commit 2faadcd

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/Illuminate/Notifications/Events/BroadcastNotificationCreated.php

+6-10
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,19 @@ public function broadcastOn()
6060
return $channels;
6161
}
6262

63-
$channelNames = $this->channelName();
64-
if (is_string($channelNames)) {
65-
return [new PrivateChannel($channelNames)];
63+
if (is_string($channels = $this->channelName())) {
64+
return [new PrivateChannel($channels)];
6665
}
6766

68-
$channels = [];
69-
foreach ($channelNames as $channel) {
70-
$channels[] = new PrivateChannel($channel);
71-
}
72-
73-
return $channels;
67+
return collect($channels)->map(function ($channel) {
68+
return new PrivateChannel($channel);
69+
})->all();
7470
}
7571

7672
/**
7773
* Get the broadcast channel name for the event.
7874
*
79-
* @return string|array
75+
* @return array|string
8076
*/
8177
protected function channelName()
8278
{

0 commit comments

Comments
 (0)