Skip to content

Commit

Permalink
clean up channel access
Browse files Browse the repository at this point in the history
  • Loading branch information
joedixon committed Jan 2, 2024
1 parent 1089c00 commit 765d415
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Protocols/Pusher/Managers/ArrayChannelManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 765d415

Please sign in to comment.