Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit 87c00fb

Browse files
committed
app() -> $this->laravel in StartWebSocketServer
1 parent eca8c7b commit 87c00fb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Console/StartWebSocketServer.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ protected function configureStatisticsLogger()
6363

6464
$browser = new Browser($this->loop, $connector);
6565

66-
app()->singleton(StatisticsLoggerInterface::class, function () use ($browser) {
67-
return new HttpStatisticsLogger(app(ChannelManager::class), $browser);
66+
$this->laravel->singleton(StatisticsLoggerInterface::class, function () use ($browser) {
67+
return new HttpStatisticsLogger($this->laravel->make(ChannelManager::class), $browser);
6868
});
6969

7070
$this->loop->addPeriodicTimer(config('websockets.statistics.interval_in_seconds'), function () {
@@ -76,7 +76,7 @@ protected function configureStatisticsLogger()
7676

7777
protected function configureHttpLogger()
7878
{
79-
app()->singleton(HttpLogger::class, function () {
79+
$this->laravel->singleton(HttpLogger::class, function () {
8080
return (new HttpLogger($this->output))
8181
->enable($this->option('debug') ?: config('app.debug'))
8282
->verbose($this->output->isVerbose());
@@ -87,7 +87,7 @@ protected function configureHttpLogger()
8787

8888
protected function configureMessageLogger()
8989
{
90-
app()->singleton(WebsocketsLogger::class, function () {
90+
$this->laravel->singleton(WebsocketsLogger::class, function () {
9191
return (new WebsocketsLogger($this->output))
9292
->enable($this->option('debug') ?: config('app.debug'))
9393
->verbose($this->output->isVerbose());
@@ -98,7 +98,7 @@ protected function configureMessageLogger()
9898

9999
protected function configureConnectionLogger()
100100
{
101-
app()->bind(ConnectionLogger::class, function () {
101+
$this->laravel->bind(ConnectionLogger::class, function () {
102102
return (new ConnectionLogger($this->output))
103103
->enable(config('app.debug'))
104104
->verbose($this->output->isVerbose());
@@ -145,7 +145,7 @@ protected function configurePubSubReplication()
145145
}
146146

147147
if (config('websockets.replication.driver') === 'redis') {
148-
app()->singleton(ReplicationInterface::class, function () {
148+
$this->laravel->singleton(ReplicationInterface::class, function () {
149149
return (new RedisClient())->boot($this->loop);
150150
});
151151
}

0 commit comments

Comments
 (0)