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

Commit 815eabc

Browse files
authored
Apply fixes from StyleCI (#448)
1 parent 8dc2856 commit 815eabc

13 files changed

+31
-31
lines changed

src/HttpApi/Controllers/FetchChannelsController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
namespace BeyondCode\LaravelWebSockets\HttpApi\Controllers;
44

5+
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
6+
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManager;
7+
use BeyondCode\LaravelWebSockets\WebSockets\Channels\PresenceChannel;
58
use Illuminate\Http\Request;
69
use Illuminate\Support\Collection;
710
use Illuminate\Support\Str;
811
use Symfony\Component\HttpKernel\Exception\HttpException;
9-
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
10-
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManager;
11-
use BeyondCode\LaravelWebSockets\WebSockets\Channels\PresenceChannel;
1212

1313
class FetchChannelsController extends Controller
1414
{
@@ -45,7 +45,7 @@ public function __invoke(Request $request)
4545
// We want to get the channel user count all in one shot when
4646
// using a replication backend rather than doing individual queries.
4747
// To do so, we first collect the list of channel names.
48-
$channelNames = $channels->map(function (PresenceChannel $channel) use ($request) {
48+
$channelNames = $channels->map(function (PresenceChannel $channel) {
4949
return $channel->getChannelName();
5050
})->toArray();
5151

src/PubSub/Broadcasters/RedisPusherBroadcaster.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
namespace BeyondCode\LaravelWebSockets\PubSub\Broadcasters;
44

5-
use Pusher\Pusher;
6-
use Illuminate\Support\Arr;
7-
use Illuminate\Support\Str;
8-
use Illuminate\Contracts\Redis\Factory as Redis;
95
use Illuminate\Broadcasting\Broadcasters\Broadcaster;
106
use Illuminate\Broadcasting\Broadcasters\UsePusherChannelConventions;
7+
use Illuminate\Contracts\Redis\Factory as Redis;
8+
use Illuminate\Support\Arr;
9+
use Illuminate\Support\Str;
10+
use Pusher\Pusher;
1111
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
1212

1313
class RedisPusherBroadcaster extends Broadcaster

src/PubSub/Drivers/LocalClient.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace BeyondCode\LaravelWebSockets\PubSub\Drivers;
44

5-
use stdClass;
5+
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
66
use React\EventLoop\LoopInterface;
77
use React\Promise\FulfilledPromise;
88
use React\Promise\PromiseInterface;
9-
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
9+
use stdClass;
1010

1111
class LocalClient implements ReplicationInterface
1212
{
@@ -23,7 +23,7 @@ class LocalClient implements ReplicationInterface
2323
* @param LoopInterface $loop
2424
* @return self
2525
*/
26-
public function boot(LoopInterface $loop) : ReplicationInterface
26+
public function boot(LoopInterface $loop): ReplicationInterface
2727
{
2828
return $this;
2929
}
@@ -36,7 +36,7 @@ public function boot(LoopInterface $loop) : ReplicationInterface
3636
* @param stdClass $payload
3737
* @return bool
3838
*/
39-
public function publish(string $appId, string $channel, stdClass $payload) : bool
39+
public function publish(string $appId, string $channel, stdClass $payload): bool
4040
{
4141
// Nothing to do, nobody to publish to
4242
return true;
@@ -49,7 +49,7 @@ public function publish(string $appId, string $channel, stdClass $payload) : boo
4949
* @param string $channel
5050
* @return bool
5151
*/
52-
public function subscribe(string $appId, string $channel) : bool
52+
public function subscribe(string $appId, string $channel): bool
5353
{
5454
return true;
5555
}
@@ -61,7 +61,7 @@ public function subscribe(string $appId, string $channel) : bool
6161
* @param string $channel
6262
* @return bool
6363
*/
64-
public function unsubscribe(string $appId, string $channel) : bool
64+
public function unsubscribe(string $appId, string $channel): bool
6565
{
6666
return true;
6767
}
@@ -103,7 +103,7 @@ public function leaveChannel(string $appId, string $channel, string $socketId)
103103
* @param string $channel
104104
* @return PromiseInterface
105105
*/
106-
public function channelMembers(string $appId, string $channel) : PromiseInterface
106+
public function channelMembers(string $appId, string $channel): PromiseInterface
107107
{
108108
$members = $this->channelData["$appId:$channel"] ?? [];
109109

@@ -122,7 +122,7 @@ public function channelMembers(string $appId, string $channel) : PromiseInterfac
122122
* @param array $channelNames
123123
* @return PromiseInterface
124124
*/
125-
public function channelMemberCounts(string $appId, array $channelNames) : PromiseInterface
125+
public function channelMemberCounts(string $appId, array $channelNames): PromiseInterface
126126
{
127127
$results = [];
128128

src/PubSub/Drivers/RedisClient.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
namespace BeyondCode\LaravelWebSockets\PubSub\Drivers;
44

5-
use stdClass;
6-
use Illuminate\Support\Str;
5+
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
6+
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManager;
77
use Clue\React\Redis\Client;
88
use Clue\React\Redis\Factory;
9+
use Illuminate\Support\Str;
910
use React\EventLoop\LoopInterface;
1011
use React\Promise\PromiseInterface;
11-
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
12-
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManager;
12+
use stdClass;
1313

1414
class RedisClient implements ReplicationInterface
1515
{

src/PubSub/ReplicationInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace BeyondCode\LaravelWebSockets\PubSub;
44

5-
use stdClass;
65
use React\EventLoop\LoopInterface;
76
use React\Promise\PromiseInterface;
7+
use stdClass;
88

99
interface ReplicationInterface
1010
{

src/WebSocketsServiceProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
use BeyondCode\LaravelWebSockets\Statistics\Http\Middleware\Authorize as AuthorizeStatistics;
1818
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManager;
1919
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManagers\ArrayChannelManager;
20-
use Pusher\Pusher;
21-
use Psr\Log\LoggerInterface;
2220
use Illuminate\Broadcasting\BroadcastManager;
2321
use Illuminate\Support\Facades\Gate;
2422
use Illuminate\Support\Facades\Route;
25-
use Illuminate\Support\ServiceProvider;
2623
use Illuminate\Support\Facades\Schema;
24+
use Illuminate\Support\ServiceProvider;
25+
use Psr\Log\LoggerInterface;
26+
use Pusher\Pusher;
2727

2828
class WebSocketsServiceProvider extends ServiceProvider
2929
{

tests/Channels/ChannelReplicationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class ChannelReplicationTest extends ChannelTest
88
{
99
use TestsReplication;
1010

11-
public function setUp() : void
11+
public function setUp(): void
1212
{
1313
parent::setUp();
1414

tests/Channels/PresenceChannelReplicationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class PresenceChannelReplicationTest extends PresenceChannelTest
88
{
99
use TestsReplication;
1010

11-
public function setUp() : void
11+
public function setUp(): void
1212
{
1313
parent::setUp();
1414

tests/HttpApi/FetchChannelReplicationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class FetchChannelReplicationTest extends FetchChannelTest
88
{
99
use TestsReplication;
1010

11-
public function setUp() : void
11+
public function setUp(): void
1212
{
1313
parent::setUp();
1414

tests/HttpApi/FetchChannelsReplicationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class FetchChannelsReplicationTest extends FetchChannelsTest
88
{
99
use TestsReplication;
1010

11-
public function setUp() : void
11+
public function setUp(): void
1212
{
1313
parent::setUp();
1414

0 commit comments

Comments
 (0)