From 87c00fb3404adb4a8955f1e839047a6845eaf6d6 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Fri, 29 Mar 2019 10:51:13 -0400 Subject: [PATCH] app() -> $this->laravel in StartWebSocketServer --- src/Console/StartWebSocketServer.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Console/StartWebSocketServer.php b/src/Console/StartWebSocketServer.php index d00e69f..4b68be3 100644 --- a/src/Console/StartWebSocketServer.php +++ b/src/Console/StartWebSocketServer.php @@ -63,8 +63,8 @@ class StartWebSocketServer extends Command $browser = new Browser($this->loop, $connector); - app()->singleton(StatisticsLoggerInterface::class, function () use ($browser) { - return new HttpStatisticsLogger(app(ChannelManager::class), $browser); + $this->laravel->singleton(StatisticsLoggerInterface::class, function () use ($browser) { + return new HttpStatisticsLogger($this->laravel->make(ChannelManager::class), $browser); }); $this->loop->addPeriodicTimer(config('websockets.statistics.interval_in_seconds'), function () { @@ -76,7 +76,7 @@ class StartWebSocketServer extends Command protected function configureHttpLogger() { - app()->singleton(HttpLogger::class, function () { + $this->laravel->singleton(HttpLogger::class, function () { return (new HttpLogger($this->output)) ->enable($this->option('debug') ?: config('app.debug')) ->verbose($this->output->isVerbose()); @@ -87,7 +87,7 @@ class StartWebSocketServer extends Command protected function configureMessageLogger() { - app()->singleton(WebsocketsLogger::class, function () { + $this->laravel->singleton(WebsocketsLogger::class, function () { return (new WebsocketsLogger($this->output)) ->enable($this->option('debug') ?: config('app.debug')) ->verbose($this->output->isVerbose()); @@ -98,7 +98,7 @@ class StartWebSocketServer extends Command protected function configureConnectionLogger() { - app()->bind(ConnectionLogger::class, function () { + $this->laravel->bind(ConnectionLogger::class, function () { return (new ConnectionLogger($this->output)) ->enable(config('app.debug')) ->verbose($this->output->isVerbose()); @@ -145,7 +145,7 @@ class StartWebSocketServer extends Command } if (config('websockets.replication.driver') === 'redis') { - app()->singleton(ReplicationInterface::class, function () { + $this->laravel->singleton(ReplicationInterface::class, function () { return (new RedisClient())->boot($this->loop); }); }