From cc4e0cb2d4acf1399d2dc9f76476aa44da975efc Mon Sep 17 00:00:00 2001 From: joedixon Date: Wed, 15 Nov 2023 13:11:20 +0000 Subject: [PATCH] Fix code styling --- src/Conn.php | 2 +- src/HttpServer.php | 6 ++---- src/Request.php | 2 +- src/Servers/Reverb/Console/Commands/StartServer.php | 2 -- src/Servers/Reverb/Factory.php | 3 +-- src/WebSockets/Request.php | 2 -- src/WebSockets/WebSocketMiddleware.php | 3 +-- 7 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/Conn.php b/src/Conn.php index 65b25f13..7c1d962a 100644 --- a/src/Conn.php +++ b/src/Conn.php @@ -60,4 +60,4 @@ public function __call($method, $parameters) return $this->connection->{$method}(...$parameters); } -} \ No newline at end of file +} diff --git a/src/HttpServer.php b/src/HttpServer.php index 7eae09ba..63a21b47 100644 --- a/src/HttpServer.php +++ b/src/HttpServer.php @@ -3,11 +3,9 @@ namespace Laravel\Reverb; use GuzzleHttp\Psr7\Message; -use GuzzleHttp\Psr7\Response; use Laravel\Reverb\Contracts\ApplicationProvider; use Laravel\Reverb\Contracts\ConnectionManager; use Laravel\Reverb\Servers\Reverb\Connection; -use Laravel\Reverb\WebSockets\Request as WebSocketRequest; use Laravel\Reverb\WebSockets\WsConnection; use Psr\Http\Message\RequestInterface; use Ratchet\RFC6455\Handshake\RequestVerifier; @@ -51,11 +49,11 @@ public function start() protected function handleRequest(string $data, Conn $connection) { - if(! $connection->isInitialized()) { + if (! $connection->isInitialized()) { $request = Request::from($data); $connection->initialize(); - if($request->getUri()->getPath() === '/app/yysmuc8zbg4vo2hxgk9w') { + if ($request->getUri()->getPath() === '/app/yysmuc8zbg4vo2hxgk9w') { $negotiator = new ServerNegotiator(new RequestVerifier); $response = $negotiator->handshake($request); diff --git a/src/Request.php b/src/Request.php index 981f8aab..9d76a832 100644 --- a/src/Request.php +++ b/src/Request.php @@ -11,4 +11,4 @@ public static function from(string $message): RequestInterface { return Message::parseRequest($message); } -} \ No newline at end of file +} diff --git a/src/Servers/Reverb/Console/Commands/StartServer.php b/src/Servers/Reverb/Console/Commands/StartServer.php index 0029afe6..dee06e39 100644 --- a/src/Servers/Reverb/Console/Commands/StartServer.php +++ b/src/Servers/Reverb/Console/Commands/StartServer.php @@ -4,10 +4,8 @@ use Illuminate\Console\Command; use Laravel\Reverb\Concerns\InteractsWithAsyncRedis; -use Laravel\Reverb\Contracts\Logger; use Laravel\Reverb\Jobs\PingInactiveConnections; use Laravel\Reverb\Jobs\PruneStaleConnections; -use Laravel\Reverb\Loggers\CliLogger; use Laravel\Reverb\Output; use Laravel\Reverb\Servers\Reverb\Factory as ServerFactory; use React\EventLoop\Loop; diff --git a/src/Servers/Reverb/Factory.php b/src/Servers/Reverb/Factory.php index 5b465686..2f8d4ecf 100644 --- a/src/Servers/Reverb/Factory.php +++ b/src/Servers/Reverb/Factory.php @@ -17,7 +17,6 @@ use React\Http\HttpServer; use React\Http\Message\Response; use React\Http\Middleware\LimitConcurrentRequestsMiddleware; -use React\Http\Middleware\RequestBodyBufferMiddleware; use React\Http\Middleware\StreamingRequestMiddleware; use React\Socket\SocketServer; use Symfony\Component\Routing\Route; @@ -29,7 +28,7 @@ class Factory * Create a new WebSocket server instance. */ public static function make(string $host = '0.0.0.0', string $port = '8080', LoopInterface $loop = null) - { + { $loop = $loop ?: Loop::get(); $socket = new SocketServer("{$host}:{$port}", [], $loop); diff --git a/src/WebSockets/Request.php b/src/WebSockets/Request.php index d0d8ba3c..3d0b96b3 100644 --- a/src/WebSockets/Request.php +++ b/src/WebSockets/Request.php @@ -3,12 +3,10 @@ namespace Laravel\Reverb\WebSockets; use Psr\Http\Message\RequestInterface; -use Psr\Http\Message\ServerRequestInterface; use Ratchet\RFC6455\Handshake\RequestVerifier; use Ratchet\RFC6455\Handshake\ServerNegotiator; use React\Http\Message\Response; use React\Stream\CompositeStream; -use React\Stream\ThroughStream; class Request { diff --git a/src/WebSockets/WebSocketMiddleware.php b/src/WebSockets/WebSocketMiddleware.php index 4e7c9761..5653e271 100644 --- a/src/WebSockets/WebSocketMiddleware.php +++ b/src/WebSockets/WebSocketMiddleware.php @@ -3,16 +3,15 @@ namespace Laravel\Reverb\WebSockets; use Closure; +use Illuminate\Support\Str; use Laravel\Reverb\Application; use Laravel\Reverb\Contracts\ApplicationProvider; use Laravel\Reverb\Contracts\ConnectionManager; use Laravel\Reverb\Server; use Laravel\Reverb\Servers\Reverb\Connection; use Laravel\Reverb\WebSockets\Request as WebSocketRequest; -use Laravel\Reverb\WebSockets\WsConnection; use Psr\Http\Message\ServerRequestInterface; use React\Http\Message\Response; -use Illuminate\Support\Str; class WebSocketMiddleware {