Fix style issues reported by StyleCI
This commit is contained in:
parent
e454f53eaa
commit
668cd29df0
|
|
@ -9,12 +9,12 @@ use React\Dns\Config\Config as DnsConfig;
|
||||||
use React\Dns\Resolver\ResolverInterface;
|
use React\Dns\Resolver\ResolverInterface;
|
||||||
use React\EventLoop\Factory as LoopFactory;
|
use React\EventLoop\Factory as LoopFactory;
|
||||||
use React\Dns\Resolver\Factory as DnsFactory;
|
use React\Dns\Resolver\Factory as DnsFactory;
|
||||||
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
|
|
||||||
use BeyondCode\LaravelWebSockets\Statistics\DnsResolver;
|
use BeyondCode\LaravelWebSockets\Statistics\DnsResolver;
|
||||||
use BeyondCode\LaravelWebSockets\Facades\StatisticsLogger;
|
use BeyondCode\LaravelWebSockets\Facades\StatisticsLogger;
|
||||||
use BeyondCode\LaravelWebSockets\Facades\WebSocketsRouter;
|
use BeyondCode\LaravelWebSockets\Facades\WebSocketsRouter;
|
||||||
use BeyondCode\LaravelWebSockets\PubSub\Redis\RedisClient;
|
use BeyondCode\LaravelWebSockets\PubSub\Redis\RedisClient;
|
||||||
use BeyondCode\LaravelWebSockets\Server\Logger\HttpLogger;
|
use BeyondCode\LaravelWebSockets\Server\Logger\HttpLogger;
|
||||||
|
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
|
||||||
use BeyondCode\LaravelWebSockets\Server\WebSocketServerFactory;
|
use BeyondCode\LaravelWebSockets\Server\WebSocketServerFactory;
|
||||||
use BeyondCode\LaravelWebSockets\Server\Logger\ConnectionLogger;
|
use BeyondCode\LaravelWebSockets\Server\Logger\ConnectionLogger;
|
||||||
use BeyondCode\LaravelWebSockets\Server\Logger\WebsocketsLogger;
|
use BeyondCode\LaravelWebSockets\Server\Logger\WebsocketsLogger;
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ class RedisClient implements ReplicationInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Boot the RedisClient, initializing the connections
|
* Boot the RedisClient, initializing the connections.
|
||||||
*
|
*
|
||||||
* @param LoopInterface $loop
|
* @param LoopInterface $loop
|
||||||
* @return ReplicationInterface
|
* @return ReplicationInterface
|
||||||
|
|
@ -74,7 +74,7 @@ class RedisClient implements ReplicationInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle a message received from Redis on a specific channel
|
* Handle a message received from Redis on a specific channel.
|
||||||
*
|
*
|
||||||
* @param string $redisChannel
|
* @param string $redisChannel
|
||||||
* @param string $payload
|
* @param string $payload
|
||||||
|
|
@ -115,7 +115,7 @@ class RedisClient implements ReplicationInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Subscribe to a channel on behalf of websocket user
|
* Subscribe to a channel on behalf of websocket user.
|
||||||
*
|
*
|
||||||
* @param string $appId
|
* @param string $appId
|
||||||
* @param string $channel
|
* @param string $channel
|
||||||
|
|
@ -136,7 +136,7 @@ class RedisClient implements ReplicationInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unsubscribe from a channel on behalf of a websocket user
|
* Unsubscribe from a channel on behalf of a websocket user.
|
||||||
*
|
*
|
||||||
* @param string $appId
|
* @param string $appId
|
||||||
* @param string $channel
|
* @param string $channel
|
||||||
|
|
@ -161,7 +161,7 @@ class RedisClient implements ReplicationInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Publish a message to a channel on behalf of a websocket user
|
* Publish a message to a channel on behalf of a websocket user.
|
||||||
*
|
*
|
||||||
* @param string $appId
|
* @param string $appId
|
||||||
* @param string $channel
|
* @param string $channel
|
||||||
|
|
@ -179,7 +179,7 @@ class RedisClient implements ReplicationInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the Redis connection URL from Laravel database config
|
* Build the Redis connection URL from Laravel database config.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
|
@ -188,7 +188,7 @@ class RedisClient implements ReplicationInterface
|
||||||
$name = config('websockets.replication.connection') ?? 'default';
|
$name = config('websockets.replication.connection') ?? 'default';
|
||||||
$config = config("database.redis.$name");
|
$config = config("database.redis.$name");
|
||||||
$host = $config['host'];
|
$host = $config['host'];
|
||||||
$port = $config['port'] ? (':' . $config['port']) : ':6379';
|
$port = $config['port'] ? (':'.$config['port']) : ':6379';
|
||||||
|
|
||||||
$query = [];
|
$query = [];
|
||||||
if ($config['password']) {
|
if ($config['password']) {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ use React\EventLoop\LoopInterface;
|
||||||
interface ReplicationInterface
|
interface ReplicationInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Boot the pub/sub provider (open connections, initial subscriptions, etc.)
|
* Boot the pub/sub provider (open connections, initial subscriptions, etc).
|
||||||
*
|
*
|
||||||
* @param LoopInterface $loop
|
* @param LoopInterface $loop
|
||||||
* @return self
|
* @return self
|
||||||
|
|
@ -16,7 +16,7 @@ interface ReplicationInterface
|
||||||
public function boot(LoopInterface $loop): self;
|
public function boot(LoopInterface $loop): self;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Publish a payload on a specific channel, for a specific app
|
* Publish a payload on a specific channel, for a specific app.
|
||||||
*
|
*
|
||||||
* @param string $appId
|
* @param string $appId
|
||||||
* @param string $channel
|
* @param string $channel
|
||||||
|
|
@ -26,7 +26,7 @@ interface ReplicationInterface
|
||||||
public function publish(string $appId, string $channel, stdClass $payload): bool;
|
public function publish(string $appId, string $channel, stdClass $payload): bool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Subscribe to receive messages for a channel
|
* Subscribe to receive messages for a channel.
|
||||||
*
|
*
|
||||||
* @param string $channel
|
* @param string $channel
|
||||||
* @return bool
|
* @return bool
|
||||||
|
|
@ -34,7 +34,7 @@ interface ReplicationInterface
|
||||||
public function subscribe(string $appId, string $channel): bool;
|
public function subscribe(string $appId, string $channel): bool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unsubscribe from a channel
|
* Unsubscribe from a channel.
|
||||||
*
|
*
|
||||||
* @param string $channel
|
* @param string $channel
|
||||||
* @return bool
|
* @return bool
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ namespace BeyondCode\LaravelWebSockets\WebSockets\Channels;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Ratchet\ConnectionInterface;
|
use Ratchet\ConnectionInterface;
|
||||||
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
|
|
||||||
use BeyondCode\LaravelWebSockets\Dashboard\DashboardLogger;
|
use BeyondCode\LaravelWebSockets\Dashboard\DashboardLogger;
|
||||||
|
use BeyondCode\LaravelWebSockets\PubSub\ReplicationInterface;
|
||||||
use BeyondCode\LaravelWebSockets\WebSockets\Exceptions\InvalidSignature;
|
use BeyondCode\LaravelWebSockets\WebSockets\Exceptions\InvalidSignature;
|
||||||
|
|
||||||
class Channel
|
class Channel
|
||||||
|
|
@ -114,6 +114,7 @@ class Channel
|
||||||
{
|
{
|
||||||
if (is_null($socketId)) {
|
if (is_null($socketId)) {
|
||||||
$this->broadcast($payload);
|
$this->broadcast($payload);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ class WebSocketsServiceProvider extends ServiceProvider
|
||||||
Console\CleanStatistics::class,
|
Console\CleanStatistics::class,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$broadcastManager->extend('redis-pusher', function(array $config) {
|
$broadcastManager->extend('redis-pusher', function (array $config) {
|
||||||
$pusher = new Pusher(
|
$pusher = new Pusher(
|
||||||
$config['key'], $config['secret'],
|
$config['key'], $config['secret'],
|
||||||
$config['app_id'], $config['options'] ?? []
|
$config['app_id'], $config['options'] ?? []
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue