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

Commit 668cd29

Browse files
committed
Fix style issues reported by StyleCI
1 parent e454f53 commit 668cd29

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

src/Console/StartWebSocketServer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
use React\Dns\Resolver\ResolverInterface;
1010
use React\EventLoop\Factory as LoopFactory;
1111
use React\Dns\Resolver\Factory as DnsFactory;
12-
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
1312
use BeyondCode\LaravelWebSockets\Statistics\DnsResolver;
1413
use BeyondCode\LaravelWebSockets\Facades\StatisticsLogger;
1514
use BeyondCode\LaravelWebSockets\Facades\WebSocketsRouter;
1615
use BeyondCode\LaravelWebSockets\PubSub\Redis\RedisClient;
1716
use BeyondCode\LaravelWebSockets\Server\Logger\HttpLogger;
17+
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
1818
use BeyondCode\LaravelWebSockets\Server\WebSocketServerFactory;
1919
use BeyondCode\LaravelWebSockets\Server\Logger\ConnectionLogger;
2020
use BeyondCode\LaravelWebSockets\Server\Logger\WebsocketsLogger;

src/PubSub/Redis/RedisClient.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct()
5151
}
5252

5353
/**
54-
* Boot the RedisClient, initializing the connections
54+
* Boot the RedisClient, initializing the connections.
5555
*
5656
* @param LoopInterface $loop
5757
* @return ReplicationInterface
@@ -74,7 +74,7 @@ public function boot(LoopInterface $loop): ReplicationInterface
7474
}
7575

7676
/**
77-
* Handle a message received from Redis on a specific channel
77+
* Handle a message received from Redis on a specific channel.
7878
*
7979
* @param string $redisChannel
8080
* @param string $payload
@@ -115,7 +115,7 @@ protected function onMessage(string $redisChannel, string $payload)
115115
}
116116

117117
/**
118-
* Subscribe to a channel on behalf of websocket user
118+
* Subscribe to a channel on behalf of websocket user.
119119
*
120120
* @param string $appId
121121
* @param string $channel
@@ -136,7 +136,7 @@ public function subscribe(string $appId, string $channel): bool
136136
}
137137

138138
/**
139-
* Unsubscribe from a channel on behalf of a websocket user
139+
* Unsubscribe from a channel on behalf of a websocket user.
140140
*
141141
* @param string $appId
142142
* @param string $channel
@@ -161,7 +161,7 @@ public function unsubscribe(string $appId, string $channel): bool
161161
}
162162

163163
/**
164-
* Publish a message to a channel on behalf of a websocket user
164+
* Publish a message to a channel on behalf of a websocket user.
165165
*
166166
* @param string $appId
167167
* @param string $channel
@@ -179,7 +179,7 @@ public function publish(string $appId, string $channel, stdClass $payload): bool
179179
}
180180

181181
/**
182-
* Build the Redis connection URL from Laravel database config
182+
* Build the Redis connection URL from Laravel database config.
183183
*
184184
* @return string
185185
*/
@@ -188,7 +188,7 @@ protected function getConnectionUri()
188188
$name = config('websockets.replication.connection') ?? 'default';
189189
$config = config("database.redis.$name");
190190
$host = $config['host'];
191-
$port = $config['port'] ? (':' . $config['port']) : ':6379';
191+
$port = $config['port'] ? (':'.$config['port']) : ':6379';
192192

193193
$query = [];
194194
if ($config['password']) {

src/PubSub/ReplicationInterface.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
interface ReplicationInterface
99
{
1010
/**
11-
* Boot the pub/sub provider (open connections, initial subscriptions, etc.)
11+
* Boot the pub/sub provider (open connections, initial subscriptions, etc).
1212
*
1313
* @param LoopInterface $loop
1414
* @return self
1515
*/
1616
public function boot(LoopInterface $loop): self;
1717

1818
/**
19-
* Publish a payload on a specific channel, for a specific app
19+
* Publish a payload on a specific channel, for a specific app.
2020
*
2121
* @param string $appId
2222
* @param string $channel
@@ -26,15 +26,15 @@ public function boot(LoopInterface $loop): self;
2626
public function publish(string $appId, string $channel, stdClass $payload): bool;
2727

2828
/**
29-
* Subscribe to receive messages for a channel
29+
* Subscribe to receive messages for a channel.
3030
*
3131
* @param string $channel
3232
* @return bool
3333
*/
3434
public function subscribe(string $appId, string $channel): bool;
3535

3636
/**
37-
* Unsubscribe from a channel
37+
* Unsubscribe from a channel.
3838
*
3939
* @param string $channel
4040
* @return bool

src/WebSockets/Channels/Channel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
use stdClass;
66
use Illuminate\Support\Str;
77
use Ratchet\ConnectionInterface;
8-
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
98
use BeyondCode\LaravelWebSockets\Dashboard\DashboardLogger;
9+
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
1010
use BeyondCode\LaravelWebSockets\WebSockets\Exceptions\InvalidSignature;
1111

1212
class Channel
@@ -114,6 +114,7 @@ public function broadcastToEveryoneExcept($payload, ?string $socketId = null, ?s
114114
{
115115
if (is_null($socketId)) {
116116
$this->broadcast($payload);
117+
117118
return;
118119
}
119120

src/WebSocketsServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function boot(BroadcastManager $broadcastManager)
4646
Console\CleanStatistics::class,
4747
]);
4848

49-
$broadcastManager->extend('redis-pusher', function(array $config) {
49+
$broadcastManager->extend('redis-pusher', function (array $config) {
5050
$pusher = new Pusher(
5151
$config['key'], $config['secret'],
5252
$config['app_id'], $config['options'] ?? []

0 commit comments

Comments
 (0)