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

Commit

Permalink
Apply fixes from StyleCI (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
rennokki authored Aug 13, 2020
1 parent 8dc2856 commit 815eabc
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 31 deletions.
8 changes: 4 additions & 4 deletions src/HttpApi/Controllers/FetchChannelsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace BeyondCode\LaravelWebSockets\HttpApi\Controllers;

use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManager;
use BeyondCode\LaravelWebSockets\WebSockets\Channels\PresenceChannel;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Symfony\Component\HttpKernel\Exception\HttpException;
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManager;
use BeyondCode\LaravelWebSockets\WebSockets\Channels\PresenceChannel;

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

Expand Down
8 changes: 4 additions & 4 deletions src/PubSub/Broadcasters/RedisPusherBroadcaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace BeyondCode\LaravelWebSockets\PubSub\Broadcasters;

use Pusher\Pusher;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Illuminate\Contracts\Redis\Factory as Redis;
use Illuminate\Broadcasting\Broadcasters\Broadcaster;
use Illuminate\Broadcasting\Broadcasters\UsePusherChannelConventions;
use Illuminate\Contracts\Redis\Factory as Redis;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Pusher\Pusher;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;

class RedisPusherBroadcaster extends Broadcaster
Expand Down
16 changes: 8 additions & 8 deletions src/PubSub/Drivers/LocalClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace BeyondCode\LaravelWebSockets\PubSub\Drivers;

use stdClass;
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
use React\EventLoop\LoopInterface;
use React\Promise\FulfilledPromise;
use React\Promise\PromiseInterface;
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
use stdClass;

class LocalClient implements ReplicationInterface
{
Expand All @@ -23,7 +23,7 @@ class LocalClient implements ReplicationInterface
* @param LoopInterface $loop
* @return self
*/
public function boot(LoopInterface $loop) : ReplicationInterface
public function boot(LoopInterface $loop): ReplicationInterface
{
return $this;
}
Expand All @@ -36,7 +36,7 @@ public function boot(LoopInterface $loop) : ReplicationInterface
* @param stdClass $payload
* @return bool
*/
public function publish(string $appId, string $channel, stdClass $payload) : bool
public function publish(string $appId, string $channel, stdClass $payload): bool
{
// Nothing to do, nobody to publish to
return true;
Expand All @@ -49,7 +49,7 @@ public function publish(string $appId, string $channel, stdClass $payload) : boo
* @param string $channel
* @return bool
*/
public function subscribe(string $appId, string $channel) : bool
public function subscribe(string $appId, string $channel): bool
{
return true;
}
Expand All @@ -61,7 +61,7 @@ public function subscribe(string $appId, string $channel) : bool
* @param string $channel
* @return bool
*/
public function unsubscribe(string $appId, string $channel) : bool
public function unsubscribe(string $appId, string $channel): bool
{
return true;
}
Expand Down Expand Up @@ -103,7 +103,7 @@ public function leaveChannel(string $appId, string $channel, string $socketId)
* @param string $channel
* @return PromiseInterface
*/
public function channelMembers(string $appId, string $channel) : PromiseInterface
public function channelMembers(string $appId, string $channel): PromiseInterface
{
$members = $this->channelData["$appId:$channel"] ?? [];

Expand All @@ -122,7 +122,7 @@ public function channelMembers(string $appId, string $channel) : PromiseInterfac
* @param array $channelNames
* @return PromiseInterface
*/
public function channelMemberCounts(string $appId, array $channelNames) : PromiseInterface
public function channelMemberCounts(string $appId, array $channelNames): PromiseInterface
{
$results = [];

Expand Down
8 changes: 4 additions & 4 deletions src/PubSub/Drivers/RedisClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace BeyondCode\LaravelWebSockets\PubSub\Drivers;

use stdClass;
use Illuminate\Support\Str;
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManager;
use Clue\React\Redis\Client;
use Clue\React\Redis\Factory;
use Illuminate\Support\Str;
use React\EventLoop\LoopInterface;
use React\Promise\PromiseInterface;
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManager;
use stdClass;

class RedisClient implements ReplicationInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/PubSub/ReplicationInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace BeyondCode\LaravelWebSockets\PubSub;

use stdClass;
use React\EventLoop\LoopInterface;
use React\Promise\PromiseInterface;
use stdClass;

interface ReplicationInterface
{
Expand Down
6 changes: 3 additions & 3 deletions src/WebSocketsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
use BeyondCode\LaravelWebSockets\Statistics\Http\Middleware\Authorize as AuthorizeStatistics;
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManager;
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManagers\ArrayChannelManager;
use Pusher\Pusher;
use Psr\Log\LoggerInterface;
use Illuminate\Broadcasting\BroadcastManager;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
use Psr\Log\LoggerInterface;
use Pusher\Pusher;

class WebSocketsServiceProvider extends ServiceProvider
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Channels/ChannelReplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ChannelReplicationTest extends ChannelTest
{
use TestsReplication;

public function setUp() : void
public function setUp(): void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/Channels/PresenceChannelReplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class PresenceChannelReplicationTest extends PresenceChannelTest
{
use TestsReplication;

public function setUp() : void
public function setUp(): void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/HttpApi/FetchChannelReplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class FetchChannelReplicationTest extends FetchChannelTest
{
use TestsReplication;

public function setUp() : void
public function setUp(): void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/HttpApi/FetchChannelsReplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class FetchChannelsReplicationTest extends FetchChannelsTest
{
use TestsReplication;

public function setUp() : void
public function setUp(): void
{
parent::setUp();

Expand Down
2 changes: 1 addition & 1 deletion tests/HttpApi/FetchUsersReplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class FetchUsersReplicationTest extends FetchUsersTest
{
use TestsReplication;

public function setUp() : void
public function setUp(): void
{
parent::setUp();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function it_can_store_statistics()
$this->assertCount(1, $entries);

$actual = $entries->first()->attributesToArray();

foreach ($this->payload() as $key => $value) {
$this->assertArrayHasKey($key, $actual);
$this->assertSame($value, $actual[$key]);
Expand Down
2 changes: 1 addition & 1 deletion tests/TestsReplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace BeyondCode\LaravelWebSockets\Tests;

use Illuminate\Support\Facades\Config;
use BeyondCode\LaravelWebSockets\PubSub\Drivers\LocalClient;
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
use Illuminate\Support\Facades\Config;

trait TestsReplication
{
Expand Down

0 comments on commit 815eabc

Please sign in to comment.