diff --git a/src/Turbo/src/Bridge/Mercure/TurboStreamListenRenderer.php b/src/Turbo/src/Bridge/Mercure/TurboStreamListenRenderer.php index 23c064ed38..68eadd8207 100644 --- a/src/Turbo/src/Bridge/Mercure/TurboStreamListenRenderer.php +++ b/src/Turbo/src/Bridge/Mercure/TurboStreamListenRenderer.php @@ -44,11 +44,9 @@ public function __construct( public function renderTurboStreamListen(Environment $env, $topic): string { - if ($topic instanceof TopicSet) { - $topics = array_map(\Closure::fromCallable([$this, 'resolveTopic']), $topic->getTopics()); - } else { - $topics = [$this->resolveTopic($topic)]; - } + $topics = $topic instanceof TopicSet + ? array_map($this->resolveTopic(...), $topic->getTopics()) + : [$this->resolveTopic($topic)]; $controllerAttributes = ['hub' => $this->hub->getPublicUrl()]; if (1 < \count($topics)) {