app() -> $this->laravel in StartWebSocketServer

This commit is contained in:
Francis Lavoie 2019-03-29 10:51:13 -04:00
parent eca8c7b846
commit 87c00fb340
No known key found for this signature in database
GPG Key ID: B9E0E04A76AF4692
1 changed files with 6 additions and 6 deletions

View File

@ -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);
});
}