diff --git a/src/Protocols/Pusher/Managers/ArrayChannelManager.php b/src/Protocols/Pusher/Managers/ArrayChannelManager.php index 9af5c37f..eaec02d1 100644 --- a/src/Protocols/Pusher/Managers/ArrayChannelManager.php +++ b/src/Protocols/Pusher/Managers/ArrayChannelManager.php @@ -118,15 +118,13 @@ public function channel(string $channel): Channel */ public function channels(?string $channel = null): Channel|array|null { - if (! isset($this->applications[$this->application->id()])) { - $this->applications[$this->application->id()] = []; - } + $channels = $this->applications[$this->application->id()] ?? []; if ($channel) { - return $this->applications[$this->application->id()][$channel] ?? null; + return $channels[$channel] ?? null; } - return $this->applications[$this->application->id()]; + return $channels; } /**