Apply fixes from StyleCI (#448)

This commit is contained in:
rennokki 2020-08-13 14:02:58 +03:00 committed by GitHub
parent 8dc28561f9
commit 815eabc801
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 33 additions and 33 deletions

View File

@ -2,13 +2,13 @@
namespace BeyondCode\LaravelWebSockets\HttpApi\Controllers; 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\Http\Request;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Symfony\Component\HttpKernel\Exception\HttpException; 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 class FetchChannelsController extends Controller
{ {
@ -45,7 +45,7 @@ class FetchChannelsController extends Controller
// We want to get the channel user count all in one shot when // We want to get the channel user count all in one shot when
// using a replication backend rather than doing individual queries. // using a replication backend rather than doing individual queries.
// To do so, we first collect the list of channel names. // 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(); return $channel->getChannelName();
})->toArray(); })->toArray();

View File

@ -2,12 +2,12 @@
namespace BeyondCode\LaravelWebSockets\PubSub\Broadcasters; 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\Broadcaster;
use Illuminate\Broadcasting\Broadcasters\UsePusherChannelConventions; 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; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
class RedisPusherBroadcaster extends Broadcaster class RedisPusherBroadcaster extends Broadcaster

View File

@ -2,11 +2,11 @@
namespace BeyondCode\LaravelWebSockets\PubSub\Drivers; namespace BeyondCode\LaravelWebSockets\PubSub\Drivers;
use stdClass; use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
use React\EventLoop\LoopInterface; use React\EventLoop\LoopInterface;
use React\Promise\FulfilledPromise; use React\Promise\FulfilledPromise;
use React\Promise\PromiseInterface; use React\Promise\PromiseInterface;
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface; use stdClass;
class LocalClient implements ReplicationInterface class LocalClient implements ReplicationInterface
{ {
@ -23,7 +23,7 @@ class LocalClient implements ReplicationInterface
* @param LoopInterface $loop * @param LoopInterface $loop
* @return self * @return self
*/ */
public function boot(LoopInterface $loop) : ReplicationInterface public function boot(LoopInterface $loop): ReplicationInterface
{ {
return $this; return $this;
} }
@ -36,7 +36,7 @@ class LocalClient implements ReplicationInterface
* @param stdClass $payload * @param stdClass $payload
* @return bool * @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 // Nothing to do, nobody to publish to
return true; return true;
@ -49,7 +49,7 @@ class LocalClient implements ReplicationInterface
* @param string $channel * @param string $channel
* @return bool * @return bool
*/ */
public function subscribe(string $appId, string $channel) : bool public function subscribe(string $appId, string $channel): bool
{ {
return true; return true;
} }
@ -61,7 +61,7 @@ class LocalClient implements ReplicationInterface
* @param string $channel * @param string $channel
* @return bool * @return bool
*/ */
public function unsubscribe(string $appId, string $channel) : bool public function unsubscribe(string $appId, string $channel): bool
{ {
return true; return true;
} }
@ -103,7 +103,7 @@ class LocalClient implements ReplicationInterface
* @param string $channel * @param string $channel
* @return PromiseInterface * @return PromiseInterface
*/ */
public function channelMembers(string $appId, string $channel) : PromiseInterface public function channelMembers(string $appId, string $channel): PromiseInterface
{ {
$members = $this->channelData["$appId:$channel"] ?? []; $members = $this->channelData["$appId:$channel"] ?? [];
@ -122,7 +122,7 @@ class LocalClient implements ReplicationInterface
* @param array $channelNames * @param array $channelNames
* @return PromiseInterface * @return PromiseInterface
*/ */
public function channelMemberCounts(string $appId, array $channelNames) : PromiseInterface public function channelMemberCounts(string $appId, array $channelNames): PromiseInterface
{ {
$results = []; $results = [];

View File

@ -2,14 +2,14 @@
namespace BeyondCode\LaravelWebSockets\PubSub\Drivers; namespace BeyondCode\LaravelWebSockets\PubSub\Drivers;
use stdClass;
use Illuminate\Support\Str;
use Clue\React\Redis\Client;
use Clue\React\Redis\Factory;
use React\EventLoop\LoopInterface;
use React\Promise\PromiseInterface;
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface; use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManager; 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 stdClass;
class RedisClient implements ReplicationInterface class RedisClient implements ReplicationInterface
{ {

View File

@ -2,9 +2,9 @@
namespace BeyondCode\LaravelWebSockets\PubSub; namespace BeyondCode\LaravelWebSockets\PubSub;
use stdClass;
use React\EventLoop\LoopInterface; use React\EventLoop\LoopInterface;
use React\Promise\PromiseInterface; use React\Promise\PromiseInterface;
use stdClass;
interface ReplicationInterface interface ReplicationInterface
{ {

View File

@ -17,13 +17,13 @@ use BeyondCode\LaravelWebSockets\Statistics\Http\Controllers\WebSocketStatistics
use BeyondCode\LaravelWebSockets\Statistics\Http\Middleware\Authorize as AuthorizeStatistics; use BeyondCode\LaravelWebSockets\Statistics\Http\Middleware\Authorize as AuthorizeStatistics;
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManager; use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManager;
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManagers\ArrayChannelManager; use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManagers\ArrayChannelManager;
use Pusher\Pusher;
use Psr\Log\LoggerInterface;
use Illuminate\Broadcasting\BroadcastManager; use Illuminate\Broadcasting\BroadcastManager;
use Illuminate\Support\Facades\Gate; use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
use Psr\Log\LoggerInterface;
use Pusher\Pusher;
class WebSocketsServiceProvider extends ServiceProvider class WebSocketsServiceProvider extends ServiceProvider
{ {

View File

@ -8,7 +8,7 @@ class ChannelReplicationTest extends ChannelTest
{ {
use TestsReplication; use TestsReplication;
public function setUp() : void public function setUp(): void
{ {
parent::setUp(); parent::setUp();

View File

@ -8,7 +8,7 @@ class PresenceChannelReplicationTest extends PresenceChannelTest
{ {
use TestsReplication; use TestsReplication;
public function setUp() : void public function setUp(): void
{ {
parent::setUp(); parent::setUp();

View File

@ -8,7 +8,7 @@ class FetchChannelReplicationTest extends FetchChannelTest
{ {
use TestsReplication; use TestsReplication;
public function setUp() : void public function setUp(): void
{ {
parent::setUp(); parent::setUp();

View File

@ -8,7 +8,7 @@ class FetchChannelsReplicationTest extends FetchChannelsTest
{ {
use TestsReplication; use TestsReplication;
public function setUp() : void public function setUp(): void
{ {
parent::setUp(); parent::setUp();

View File

@ -8,7 +8,7 @@ class FetchUsersReplicationTest extends FetchUsersTest
{ {
use TestsReplication; use TestsReplication;
public function setUp() : void public function setUp(): void
{ {
parent::setUp(); parent::setUp();

View File

@ -2,9 +2,9 @@
namespace BeyondCode\LaravelWebSockets\Tests; namespace BeyondCode\LaravelWebSockets\Tests;
use Illuminate\Support\Facades\Config;
use BeyondCode\LaravelWebSockets\PubSub\Drivers\LocalClient; use BeyondCode\LaravelWebSockets\PubSub\Drivers\LocalClient;
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface; use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
use Illuminate\Support\Facades\Config;
trait TestsReplication trait TestsReplication
{ {