This commit is contained in:
Marcel Pociot 2018-11-22 23:58:50 +01:00
parent c6c65fde8a
commit 20b92fddfc
1 changed files with 2 additions and 5 deletions

View File

@ -2,7 +2,7 @@
namespace BeyondCode\LaravelWebSockets\LaravelEcho\Pusher\Channels;
use ReflectionClass;
use Ratchet\ConnectionInterface;
class ChannelManager
@ -16,10 +16,7 @@ class ChannelManager
public function findOrCreate(string $appId, string $channelId): Channel
{
if (!isset($this->channels[$appId][$channelId])) {
/**TODO: make this variable to go away */
$channelClass = $this->detectChannelClass($channelId);
$this->channels[$appId][$channelId] = new $channelClass($channelId);
$this->channels[$appId][$channelId] = (new ReflectionClass($this->detectChannelClass($channelId)))->newInstance($channelId);
}
return $this->channels[$appId][$channelId];