Skip to content

Commit 5552863

Browse files
committed
[Turbo] Simplify $topics
1 parent 1bd9bfd commit 5552863

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Turbo/src/Bridge/Mercure/TurboStreamListenRenderer.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,9 @@ public function __construct(
4444

4545
public function renderTurboStreamListen(Environment $env, $topic): string
4646
{
47-
if ($topic instanceof TopicSet) {
48-
$topics = array_map(\Closure::fromCallable([$this, 'resolveTopic']), $topic->getTopics());
49-
} else {
50-
$topics = [$this->resolveTopic($topic)];
51-
}
47+
$topics = $topic instanceof TopicSet
48+
? array_map($this->resolveTopic(...), $topic->getTopics())
49+
: [$this->resolveTopic($topic)];
5250

5351
$controllerAttributes = ['hub' => $this->hub->getPublicUrl()];
5452
if (1 < \count($topics)) {

0 commit comments

Comments
 (0)