diff --git a/src/Contracts/Connection.php b/src/Contracts/Connection.php index 53ab3b13..b670122e 100644 --- a/src/Contracts/Connection.php +++ b/src/Contracts/Connection.php @@ -2,7 +2,6 @@ namespace Laravel\Reverb\Contracts; -use Evenement\EventEmitter; use Laravel\Reverb\Application; abstract class Connection diff --git a/src/Jobs/PingInactiveConnections.php b/src/Jobs/PingInactiveConnections.php index 22d44bc8..e7ddb20e 100644 --- a/src/Jobs/PingInactiveConnections.php +++ b/src/Jobs/PingInactiveConnections.php @@ -4,8 +4,8 @@ use Illuminate\Foundation\Bus\Dispatchable; use Laravel\Reverb\Contracts\ApplicationProvider; -use Laravel\Reverb\Pusher\Contracts\ChannelManager; use Laravel\Reverb\Loggers\Log; +use Laravel\Reverb\Pusher\Contracts\ChannelManager; use Laravel\Reverb\Pusher\Event as PusherEvent; class PingInactiveConnections diff --git a/src/Jobs/PruneStaleConnections.php b/src/Jobs/PruneStaleConnections.php index 50ec7b12..fefb725b 100644 --- a/src/Jobs/PruneStaleConnections.php +++ b/src/Jobs/PruneStaleConnections.php @@ -4,8 +4,8 @@ use Illuminate\Foundation\Bus\Dispatchable; use Laravel\Reverb\Contracts\ApplicationProvider; -use Laravel\Reverb\Pusher\Contracts\ChannelManager; use Laravel\Reverb\Loggers\Log; +use Laravel\Reverb\Pusher\Contracts\ChannelManager; class PruneStaleConnections { diff --git a/src/Pusher/Channels/Channel.php b/src/Pusher/Channels/Channel.php index 21626e40..28680fc3 100644 --- a/src/Pusher/Channels/Channel.php +++ b/src/Pusher/Channels/Channel.php @@ -2,10 +2,10 @@ namespace Laravel\Reverb\Pusher\Channels; +use Laravel\Reverb\Contracts\Connection; use Laravel\Reverb\Pusher\Concerns\SerializesChannels; use Laravel\Reverb\Pusher\Contracts\ChannelConnectionManager; use Laravel\Reverb\Pusher\Contracts\ChannelManager; -use Laravel\Reverb\Contracts\Connection; class Channel { diff --git a/src/Pusher/Channels/Concerns/InteractsWithPrivateChannels.php b/src/Pusher/Channels/Concerns/InteractsWithPrivateChannels.php index d4e63b96..f89d6556 100644 --- a/src/Pusher/Channels/Concerns/InteractsWithPrivateChannels.php +++ b/src/Pusher/Channels/Concerns/InteractsWithPrivateChannels.php @@ -24,11 +24,11 @@ public function subscribe(Connection $connection, ?string $auth = null, ?string protected function verify(Connection $connection, string $auth, ?string $data = null): bool { $signature = "{$connection->id()}:{$this->name()}"; - + if ($data) { $signature .= ":{$data}"; } - + if (! hash_equals( hash_hmac( 'sha256', diff --git a/src/Pusher/Event.php b/src/Pusher/Event.php index e011cb09..268ba068 100644 --- a/src/Pusher/Event.php +++ b/src/Pusher/Event.php @@ -4,10 +4,10 @@ use Exception; use Illuminate\Support\Str; +use Laravel\Reverb\Contracts\Connection; use Laravel\Reverb\Pusher\Channels\CacheChannel; use Laravel\Reverb\Pusher\Channels\Channel; use Laravel\Reverb\Pusher\Contracts\ChannelManager; -use Laravel\Reverb\Contracts\Connection; class Event { diff --git a/src/Pusher/EventDispatcher.php b/src/Pusher/EventDispatcher.php index d227fce1..ff8033ba 100644 --- a/src/Pusher/EventDispatcher.php +++ b/src/Pusher/EventDispatcher.php @@ -4,8 +4,8 @@ use Illuminate\Support\Arr; use Laravel\Reverb\Application; -use Laravel\Reverb\Pusher\Contracts\ChannelManager; use Laravel\Reverb\Contracts\Connection; +use Laravel\Reverb\Pusher\Contracts\ChannelManager; use Laravel\Reverb\ServerManager; class EventDispatcher diff --git a/src/Pusher/Http/Controllers/ChannelController.php b/src/Pusher/Http/Controllers/ChannelController.php index c69be696..c749f9b2 100644 --- a/src/Pusher/Http/Controllers/ChannelController.php +++ b/src/Pusher/Http/Controllers/ChannelController.php @@ -2,8 +2,8 @@ namespace Laravel\Reverb\Pusher\Http\Controllers; -use Laravel\Reverb\Servers\Reverb\Http\Connection; use Laravel\Reverb\Pusher\Concerns\InteractsWithChannelInformation; +use Laravel\Reverb\Servers\Reverb\Http\Connection; use Psr\Http\Message\RequestInterface; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; diff --git a/src/Pusher/Http/Controllers/ChannelUsersController.php b/src/Pusher/Http/Controllers/ChannelUsersController.php index d8810f77..c5e2a039 100644 --- a/src/Pusher/Http/Controllers/ChannelUsersController.php +++ b/src/Pusher/Http/Controllers/ChannelUsersController.php @@ -2,8 +2,8 @@ namespace Laravel\Reverb\Pusher\Http\Controllers; -use Laravel\Reverb\Servers\Reverb\Http\Connection; use Laravel\Reverb\Pusher\Concerns\InteractsWithChannelInformation; +use Laravel\Reverb\Servers\Reverb\Http\Connection; use Psr\Http\Message\RequestInterface; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; diff --git a/src/Pusher/Http/Controllers/ChannelsController.php b/src/Pusher/Http/Controllers/ChannelsController.php index 71841439..1ac5d722 100644 --- a/src/Pusher/Http/Controllers/ChannelsController.php +++ b/src/Pusher/Http/Controllers/ChannelsController.php @@ -3,8 +3,8 @@ namespace Laravel\Reverb\Pusher\Http\Controllers; use Illuminate\Support\Str; -use Laravel\Reverb\Servers\Reverb\Http\Connection; use Laravel\Reverb\Pusher\Concerns\InteractsWithChannelInformation; +use Laravel\Reverb\Servers\Reverb\Http\Connection; use Psr\Http\Message\RequestInterface; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; diff --git a/src/Pusher/Http/Controllers/Controller.php b/src/Pusher/Http/Controllers/Controller.php index d1c2dbd8..5f079387 100644 --- a/src/Pusher/Http/Controllers/Controller.php +++ b/src/Pusher/Http/Controllers/Controller.php @@ -4,10 +4,10 @@ use Illuminate\Support\Arr; use Laravel\Reverb\Application; -use Laravel\Reverb\Servers\Reverb\Concerns\ClosesConnections; use Laravel\Reverb\Contracts\ApplicationProvider; -use Laravel\Reverb\Pusher\Contracts\ChannelManager; use Laravel\Reverb\Exceptions\InvalidApplication; +use Laravel\Reverb\Pusher\Contracts\ChannelManager; +use Laravel\Reverb\Servers\Reverb\Concerns\ClosesConnections; use Laravel\Reverb\Servers\Reverb\Http\Connection; use Psr\Http\Message\RequestInterface; use Symfony\Component\HttpKernel\Exception\HttpException; diff --git a/src/Pusher/Http/Controllers/EventsBatchController.php b/src/Pusher/Http/Controllers/EventsBatchController.php index 3122d65e..5fe2b0fc 100644 --- a/src/Pusher/Http/Controllers/EventsBatchController.php +++ b/src/Pusher/Http/Controllers/EventsBatchController.php @@ -4,9 +4,9 @@ use Illuminate\Contracts\Validation\Validator; use Illuminate\Support\Facades\Validator as ValidatorFacade; +use Laravel\Reverb\Pusher\Concerns\InteractsWithChannelInformation; use Laravel\Reverb\Pusher\EventDispatcher; use Laravel\Reverb\Servers\Reverb\Http\Connection; -use Laravel\Reverb\Pusher\Concerns\InteractsWithChannelInformation; use Psr\Http\Message\RequestInterface; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; diff --git a/src/Pusher/Http/Controllers/EventsController.php b/src/Pusher/Http/Controllers/EventsController.php index dd25608f..b5dfb384 100644 --- a/src/Pusher/Http/Controllers/EventsController.php +++ b/src/Pusher/Http/Controllers/EventsController.php @@ -5,9 +5,9 @@ use Illuminate\Contracts\Validation\Validator; use Illuminate\Support\Arr; use Illuminate\Support\Facades\Validator as ValidatorFacade; +use Laravel\Reverb\Pusher\Concerns\InteractsWithChannelInformation; use Laravel\Reverb\Pusher\EventDispatcher; use Laravel\Reverb\Servers\Reverb\Http\Connection; -use Laravel\Reverb\Pusher\Concerns\InteractsWithChannelInformation; use Psr\Http\Message\RequestInterface; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; diff --git a/src/Pusher/Http/Controllers/PusherController.php b/src/Pusher/Http/Controllers/PusherController.php index 94c9310a..860ba5d6 100644 --- a/src/Pusher/Http/Controllers/PusherController.php +++ b/src/Pusher/Http/Controllers/PusherController.php @@ -2,10 +2,10 @@ namespace Laravel\Reverb\Pusher\Http\Controllers; +use Laravel\Reverb\Connection as ReverbConnection; use Laravel\Reverb\Contracts\ApplicationProvider; use Laravel\Reverb\Exceptions\InvalidApplication; use Laravel\Reverb\Pusher\Server as PusherServer; -use Laravel\Reverb\Connection as ReverbConnection; use Laravel\Reverb\Servers\Reverb\Connection; use Psr\Http\Message\RequestInterface; diff --git a/src/Pusher/Managers/ArrayChannelConnectionManager.php b/src/Pusher/Managers/ArrayChannelConnectionManager.php index 4f3b1547..0d8593e2 100644 --- a/src/Pusher/Managers/ArrayChannelConnectionManager.php +++ b/src/Pusher/Managers/ArrayChannelConnectionManager.php @@ -2,9 +2,9 @@ namespace Laravel\Reverb\Pusher\Managers; -use Laravel\Reverb\Pusher\Contracts\ChannelConnectionManager; use Laravel\Reverb\Contracts\Connection; use Laravel\Reverb\Pusher\Channels\ChannelConnection; +use Laravel\Reverb\Pusher\Contracts\ChannelConnectionManager; class ArrayChannelConnectionManager implements ChannelConnectionManager { diff --git a/src/Pusher/Managers/ArrayChannelManager.php b/src/Pusher/Managers/ArrayChannelManager.php index 7236db34..3bd79b7b 100644 --- a/src/Pusher/Managers/ArrayChannelManager.php +++ b/src/Pusher/Managers/ArrayChannelManager.php @@ -4,12 +4,12 @@ use Illuminate\Support\Arr; use Laravel\Reverb\Application; -use Laravel\Reverb\Pusher\Channels\Channel; -use Laravel\Reverb\Pusher\Channels\ChannelBroker; use Laravel\Reverb\Concerns\InteractsWithApplications; use Laravel\Reverb\Contracts\ApplicationProvider; -use Laravel\Reverb\Pusher\Contracts\ChannelManager as ChannelManagerInterface; use Laravel\Reverb\Contracts\Connection; +use Laravel\Reverb\Pusher\Channels\Channel; +use Laravel\Reverb\Pusher\Channels\ChannelBroker; +use Laravel\Reverb\Pusher\Contracts\ChannelManager as ChannelManagerInterface; class ArrayChannelManager implements ChannelManagerInterface { diff --git a/src/Pusher/Managers/CacheChannelConnectionManager.php b/src/Pusher/Managers/CacheChannelConnectionManager.php index 3eca3f2a..f824b1ee 100644 --- a/src/Pusher/Managers/CacheChannelConnectionManager.php +++ b/src/Pusher/Managers/CacheChannelConnectionManager.php @@ -3,10 +3,10 @@ namespace Laravel\Reverb\Pusher\Managers; use Illuminate\Contracts\Cache\Repository; -use Laravel\Reverb\Pusher\Contracts\ChannelConnectionManager; use Laravel\Reverb\Contracts\Connection; use Laravel\Reverb\Contracts\ConnectionManager; use Laravel\Reverb\Pusher\Channels\ChannelConnection; +use Laravel\Reverb\Pusher\Contracts\ChannelConnectionManager; class CacheChannelConnectionManager implements ChannelConnectionManager { diff --git a/src/Pusher/Managers/CacheChannelManager.php b/src/Pusher/Managers/CacheChannelManager.php index cf2891d1..aae40f86 100644 --- a/src/Pusher/Managers/CacheChannelManager.php +++ b/src/Pusher/Managers/CacheChannelManager.php @@ -5,11 +5,11 @@ use Illuminate\Contracts\Cache\Repository; use Illuminate\Support\Arr; use Laravel\Reverb\Application; +use Laravel\Reverb\Concerns\InteractsWithApplications; +use Laravel\Reverb\Contracts\Connection; use Laravel\Reverb\Pusher\Channels\Channel; use Laravel\Reverb\Pusher\Channels\ChannelBroker; -use Laravel\Reverb\Concerns\InteractsWithApplications; use Laravel\Reverb\Pusher\Contracts\ChannelManager as ChannelManagerInterface; -use Laravel\Reverb\Contracts\Connection; class CacheChannelManager implements ChannelManagerInterface { diff --git a/src/Pusher/Server.php b/src/Pusher/Server.php index d4df252f..b4dd4ebf 100644 --- a/src/Pusher/Server.php +++ b/src/Pusher/Server.php @@ -4,14 +4,12 @@ use Exception; use Illuminate\Support\Str; -use Laravel\Reverb\Pusher\ClientEvent; -use Laravel\Reverb\Pusher\Contracts\ChannelManager; use Laravel\Reverb\Contracts\Connection; -use Laravel\Reverb\Contracts\ConnectionManager; use Laravel\Reverb\Exceptions\InvalidOrigin; -use Laravel\Reverb\Pusher\Exceptions\PusherException; use Laravel\Reverb\Loggers\Log; +use Laravel\Reverb\Pusher\Contracts\ChannelManager; use Laravel\Reverb\Pusher\Event as PusherEvent; +use Laravel\Reverb\Pusher\Exceptions\PusherException; class Server { diff --git a/src/Servers/ApiGateway/ApiGatewayProvider.php b/src/Servers/ApiGateway/ApiGatewayProvider.php index 2d545d89..67579770 100644 --- a/src/Servers/ApiGateway/ApiGatewayProvider.php +++ b/src/Servers/ApiGateway/ApiGatewayProvider.php @@ -7,17 +7,17 @@ use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; +use Laravel\Reverb\CacheConnectionManager; use Laravel\Reverb\Contracts\ApplicationProvider; -use Laravel\Reverb\Pusher\Contracts\ChannelConnectionManager; -use Laravel\Reverb\Pusher\Contracts\ChannelManager; use Laravel\Reverb\Contracts\ConnectionManager; use Laravel\Reverb\Contracts\ServerProvider; -use Laravel\Reverb\Pusher\EventDispatcher; use Laravel\Reverb\Jobs\PingInactiveConnections; use Laravel\Reverb\Jobs\PruneStaleConnections; +use Laravel\Reverb\Pusher\Contracts\ChannelConnectionManager; +use Laravel\Reverb\Pusher\Contracts\ChannelManager; +use Laravel\Reverb\Pusher\EventDispatcher; use Laravel\Reverb\Pusher\Managers\CacheChannelConnectionManager; use Laravel\Reverb\Pusher\Managers\CacheChannelManager; -use Laravel\Reverb\CacheConnectionManager; class ApiGatewayProvider extends ServerProvider { diff --git a/src/Servers/ApiGateway/Connection.php b/src/Servers/ApiGateway/Connection.php index c428d356..4642fb38 100644 --- a/src/Servers/ApiGateway/Connection.php +++ b/src/Servers/ApiGateway/Connection.php @@ -2,7 +2,6 @@ namespace Laravel\Reverb\Servers\ApiGateway; -use Laravel\Reverb\Contracts\ConnectionManager; use Laravel\Reverb\Contracts\WebSocketConnection; use Laravel\Reverb\Servers\ApiGateway\Jobs\SendToConnection; @@ -37,6 +36,6 @@ public function send(mixed $message): void */ public function close(mixed $message = null): void { - // + // } } diff --git a/src/Servers/Reverb/Factory.php b/src/Servers/Reverb/Factory.php index 16d6d9df..5a412ffa 100644 --- a/src/Servers/Reverb/Factory.php +++ b/src/Servers/Reverb/Factory.php @@ -3,23 +3,23 @@ namespace Laravel\Reverb\Servers\Reverb; use Laravel\Reverb\Contracts\ApplicationProvider; -use Laravel\Reverb\Servers\Reverb\Http\Route; -use Laravel\Reverb\Servers\Reverb\Http\Router; -use Laravel\Reverb\Servers\Reverb\Http\Server as HttpServer; use Laravel\Reverb\Pusher\Http\Controllers\ChannelController; use Laravel\Reverb\Pusher\Http\Controllers\ChannelsController; use Laravel\Reverb\Pusher\Http\Controllers\ChannelUsersController; use Laravel\Reverb\Pusher\Http\Controllers\EventsBatchController; use Laravel\Reverb\Pusher\Http\Controllers\EventsController; +use Laravel\Reverb\Pusher\Http\Controllers\PusherController; use Laravel\Reverb\Pusher\Http\Controllers\UsersTerminateController; use Laravel\Reverb\Pusher\Server as PusherServer; +use Laravel\Reverb\Servers\Reverb\Http\Route; +use Laravel\Reverb\Servers\Reverb\Http\Router; +use Laravel\Reverb\Servers\Reverb\Http\Server as HttpServer; use React\EventLoop\Loop; use React\EventLoop\LoopInterface; use React\Socket\SocketServer; use Symfony\Component\Routing\Matcher\UrlMatcher; use Symfony\Component\Routing\RequestContext; use Symfony\Component\Routing\RouteCollection; -use Laravel\Reverb\Pusher\Http\Controllers\PusherController; class Factory { diff --git a/src/Servers/Reverb/ReverbProvider.php b/src/Servers/Reverb/ReverbProvider.php index 8241a5db..4f069745 100644 --- a/src/Servers/Reverb/ReverbProvider.php +++ b/src/Servers/Reverb/ReverbProvider.php @@ -7,9 +7,9 @@ use Illuminate\Console\Application as Artisan; use Illuminate\Contracts\Foundation\Application; use Laravel\Reverb\Concerns\InteractsWithAsyncRedis; +use Laravel\Reverb\Contracts\ServerProvider; use Laravel\Reverb\Pusher\Contracts\ChannelConnectionManager; use Laravel\Reverb\Pusher\Contracts\ChannelManager; -use Laravel\Reverb\Contracts\ServerProvider; use Laravel\Reverb\Pusher\EventDispatcher; use Laravel\Reverb\Pusher\Managers\ArrayChannelConnectionManager; use Laravel\Reverb\Pusher\Managers\ArrayChannelManager; diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 1b05ba6a..b3cdd81f 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -3,10 +3,10 @@ namespace Laravel\Reverb; use Illuminate\Support\ServiceProvider as BaseServiceProvider; -use Laravel\Reverb\Pusher\Contracts\ChannelConnectionManager; -use Laravel\Reverb\Pusher\Contracts\ChannelManager; use Laravel\Reverb\Contracts\Logger; use Laravel\Reverb\Loggers\NullLogger; +use Laravel\Reverb\Pusher\Contracts\ChannelConnectionManager; +use Laravel\Reverb\Pusher\Contracts\ChannelManager; class ServiceProvider extends BaseServiceProvider { diff --git a/tests/FakeConnection.php b/tests/FakeConnection.php index c4d51644..aeb61dd3 100644 --- a/tests/FakeConnection.php +++ b/tests/FakeConnection.php @@ -4,9 +4,9 @@ use Illuminate\Testing\Assert; use Laravel\Reverb\Application; +use Laravel\Reverb\Concerns\GeneratesIdentifiers; use Laravel\Reverb\Contracts\ApplicationProvider; use Laravel\Reverb\Contracts\Connection as BaseConnection; -use Laravel\Reverb\Concerns\GeneratesIdentifiers; class FakeConnection extends BaseConnection { diff --git a/tests/Pest.php b/tests/Pest.php index 1aa3d466..017b5e6f 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -3,9 +3,9 @@ use Illuminate\Support\Collection; use Laravel\Reverb\Application; use Laravel\Reverb\Contracts\ApplicationProvider; -use Laravel\Reverb\Pusher\Contracts\ChannelManager; use Laravel\Reverb\Managers\Connections; use Laravel\Reverb\Pusher\Channels\ChannelConnection; +use Laravel\Reverb\Pusher\Contracts\ChannelManager; use Laravel\Reverb\Tests\FakeConnection; use Laravel\Reverb\Tests\SerializableConnection; use Laravel\Reverb\Tests\TestCase; diff --git a/tests/ReverbTestCase.php b/tests/ReverbTestCase.php index 34b463c3..21902c2f 100644 --- a/tests/ReverbTestCase.php +++ b/tests/ReverbTestCase.php @@ -4,7 +4,6 @@ use Illuminate\Support\Str; use Laravel\Reverb\Concerns\InteractsWithAsyncRedis; -use Laravel\Reverb\Pusher\EventDispatcher; use Laravel\Reverb\ServerManager; use Laravel\Reverb\Servers\Reverb\Factory; use Ratchet\Client\WebSocket; diff --git a/tests/Specification/spec-server.php b/tests/Specification/spec-server.php index 892e864b..df5b19c6 100644 --- a/tests/Specification/spec-server.php +++ b/tests/Specification/spec-server.php @@ -1,9 +1,9 @@ channelManager = Mockery::spy(ChannelManager::class); diff --git a/tests/Unit/Jobs/PruneStaleConnectionsTest.php b/tests/Unit/Jobs/PruneStaleConnectionsTest.php index 1e806aed..4527ad37 100644 --- a/tests/Unit/Jobs/PruneStaleConnectionsTest.php +++ b/tests/Unit/Jobs/PruneStaleConnectionsTest.php @@ -1,8 +1,8 @@ channelManager = Mockery::spy(ChannelManager::class);