From 9507fbef790538c993d03434db02d3be654e2c0d Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Wed, 26 Apr 2023 11:30:39 +0000 Subject: [PATCH] Apply fixes from StyleCI --- app/Client/Client.php | 3 ++- app/Client/Http/HttpClient.php | 3 ++- app/Client/ProxyManager.php | 3 ++- app/Http/Controllers/Concerns/LoadsViews.php | 3 ++- app/Http/Controllers/Controller.php | 3 ++- app/Logger/LoggedRequest.php | 3 ++- app/Server/Http/Controllers/ControlMessageController.php | 3 ++- app/Server/Http/Controllers/TunnelMessageController.php | 3 ++- app/Server/Http/Router.php | 7 ++++--- tests/Feature/Client/DashboardTest.php | 3 ++- tests/Feature/TestCase.php | 3 ++- tests/Unit/LoggedRequestTest.php | 3 ++- tests/Unit/RequestLoggerTest.php | 3 ++- 13 files changed, 28 insertions(+), 15 deletions(-) diff --git a/app/Client/Client.php b/app/Client/Client.php index 88b81c2..5e36b43 100644 --- a/app/Client/Client.php +++ b/app/Client/Client.php @@ -6,12 +6,13 @@ use App\Logger\CliRequestLogger; use Carbon\Carbon; use Illuminate\Support\Arr; -use function Ratchet\Client\connect; use Ratchet\Client\WebSocket; use React\EventLoop\LoopInterface; use React\Promise\Deferred; use React\Promise\PromiseInterface; +use function Ratchet\Client\connect; + class Client { protected const MAX_CONNECTION_RETRIES = 3; diff --git a/app/Client/Http/HttpClient.php b/app/Client/Http/HttpClient.php index e0fbca5..43aa142 100644 --- a/app/Client/Http/HttpClient.php +++ b/app/Client/Http/HttpClient.php @@ -6,7 +6,6 @@ use App\Client\Http\Modifiers\CheckBasicAuthentication; use App\Logger\RequestLogger; use GuzzleHttp\Psr7\Message; -use function GuzzleHttp\Psr7\parse_request; use Laminas\Http\Request; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; @@ -16,6 +15,8 @@ use React\Http\Browser; use React\Socket\Connector; +use function GuzzleHttp\Psr7\parse_request; + class HttpClient { /** @var LoopInterface */ diff --git a/app/Client/ProxyManager.php b/app/Client/ProxyManager.php index 1b4ac35..d443ab7 100644 --- a/app/Client/ProxyManager.php +++ b/app/Client/ProxyManager.php @@ -3,12 +3,13 @@ namespace App\Client; use App\Client\Http\HttpClient; -use function Ratchet\Client\connect; use Ratchet\Client\WebSocket; use Ratchet\RFC6455\Messaging\Frame; use React\EventLoop\LoopInterface; use React\Socket\Connector; +use function Ratchet\Client\connect; + class ProxyManager { /** @var Configuration */ diff --git a/app/Http/Controllers/Concerns/LoadsViews.php b/app/Http/Controllers/Concerns/LoadsViews.php index e5b8375..6c2ef64 100644 --- a/app/Http/Controllers/Concerns/LoadsViews.php +++ b/app/Http/Controllers/Concerns/LoadsViews.php @@ -2,11 +2,12 @@ namespace App\Http\Controllers\Concerns; -use function GuzzleHttp\Psr7\stream_for; use Ratchet\ConnectionInterface; use Twig\Environment; use Twig\Loader\ArrayLoader; +use function GuzzleHttp\Psr7\stream_for; + trait LoadsViews { protected function getView(?ConnectionInterface $connection, string $view, array $data = []) diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 78acf0e..5c2c208 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -4,12 +4,13 @@ use App\Http\Controllers\Concerns\LoadsViews; use App\Http\Controllers\Concerns\ParsesIncomingRequest; -use function GuzzleHttp\Psr7\parse_request; use Illuminate\Http\Request; use Psr\Http\Message\RequestInterface; use Ratchet\ConnectionInterface; use Ratchet\Http\HttpServerInterface; +use function GuzzleHttp\Psr7\parse_request; + abstract class Controller implements HttpServerInterface { use LoadsViews; diff --git a/app/Logger/LoggedRequest.php b/app/Logger/LoggedRequest.php index e6806cd..aab949d 100644 --- a/app/Logger/LoggedRequest.php +++ b/app/Logger/LoggedRequest.php @@ -4,7 +4,6 @@ use Carbon\Carbon; use GuzzleHttp\Psr7\Message; -use function GuzzleHttp\Psr7\parse_request; use Illuminate\Support\Arr; use Illuminate\Support\Str; use Laminas\Http\Header\GenericHeader; @@ -13,6 +12,8 @@ use Namshi\Cuzzle\Formatter\CurlFormatter; use Riverline\MultiPartParser\StreamedPart; +use function GuzzleHttp\Psr7\parse_request; + class LoggedRequest implements \JsonSerializable { /** @var string */ diff --git a/app/Server/Http/Controllers/ControlMessageController.php b/app/Server/Http/Controllers/ControlMessageController.php index 0c17a95..dfa08eb 100644 --- a/app/Server/Http/Controllers/ControlMessageController.php +++ b/app/Server/Http/Controllers/ControlMessageController.php @@ -14,9 +14,10 @@ use Ratchet\WebSocket\MessageComponentInterface; use React\Promise\Deferred; use React\Promise\PromiseInterface; -use function React\Promise\reject; use stdClass; +use function React\Promise\reject; + class ControlMessageController implements MessageComponentInterface { /** @var ConnectionManager */ diff --git a/app/Server/Http/Controllers/TunnelMessageController.php b/app/Server/Http/Controllers/TunnelMessageController.php index 455ba94..ec1b28e 100644 --- a/app/Server/Http/Controllers/TunnelMessageController.php +++ b/app/Server/Http/Controllers/TunnelMessageController.php @@ -8,7 +8,6 @@ use App\Server\Configuration; use App\Server\Connections\ControlConnection; use App\Server\Connections\HttpConnection; -use function GuzzleHttp\Psr7\str; use Illuminate\Http\Request; use Illuminate\Support\Str; use Nyholm\Psr7\Factory\Psr17Factory; @@ -16,6 +15,8 @@ use Ratchet\RFC6455\Messaging\Frame; use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory; +use function GuzzleHttp\Psr7\str; + class TunnelMessageController extends Controller { /** @var ConnectionManager */ diff --git a/app/Server/Http/Router.php b/app/Server/Http/Router.php index 3ef7609..5e59176 100644 --- a/app/Server/Http/Router.php +++ b/app/Server/Http/Router.php @@ -3,8 +3,6 @@ namespace App\Server\Http; use App\Http\QueryParameters; -use function GuzzleHttp\Psr7\build_query; -use function GuzzleHttp\Psr7\parse_query; use GuzzleHttp\Psr7\ServerRequest; use Psr\Http\Message\RequestInterface; use Ratchet\ConnectionInterface; @@ -16,6 +14,9 @@ use Symfony\Component\Routing\Exception\ResourceNotFoundException; use Symfony\Component\Routing\Matcher\UrlMatcher; +use function GuzzleHttp\Psr7\build_query; +use function GuzzleHttp\Psr7\parse_query; + class Router implements HttpServerInterface { use CloseResponseTrait; @@ -72,7 +73,7 @@ public function onOpen(ConnectionInterface $conn, RequestInterface $request = nu $parameters = []; foreach ($route as $key => $value) { - if ((is_string($key)) && ('_' !== substr($key, 0, 1))) { + if (is_string($key) && ('_' !== substr($key, 0, 1))) { $parameters[$key] = $value; } } diff --git a/tests/Feature/Client/DashboardTest.php b/tests/Feature/Client/DashboardTest.php index 2b50840..b0fba54 100755 --- a/tests/Feature/Client/DashboardTest.php +++ b/tests/Feature/Client/DashboardTest.php @@ -9,7 +9,6 @@ use App\Logger\RequestLogger; use GuzzleHttp\Psr7\Message; use GuzzleHttp\Psr7\Request; -use function GuzzleHttp\Psr7\str; use Illuminate\Support\Arr; use Mockery as m; use Psr\Http\Message\RequestInterface; @@ -18,6 +17,8 @@ use React\Http\Message\ResponseException; use Tests\Feature\TestCase; +use function GuzzleHttp\Psr7\str; + class DashboardTest extends TestCase { /** @var Browser */ diff --git a/tests/Feature/TestCase.php b/tests/Feature/TestCase.php index c260bd9..b9b878d 100644 --- a/tests/Feature/TestCase.php +++ b/tests/Feature/TestCase.php @@ -2,13 +2,14 @@ namespace Tests\Feature; -use function Clue\React\Block\await; use Clue\React\SQLite\DatabaseInterface; use React\EventLoop\LoopInterface; use React\Promise\PromiseInterface; use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Output\ConsoleOutputInterface; +use function Clue\React\Block\await; + abstract class TestCase extends \Tests\TestCase { const AWAIT_TIMEOUT = 5.0; diff --git a/tests/Unit/LoggedRequestTest.php b/tests/Unit/LoggedRequestTest.php index 98b180b..3655672 100644 --- a/tests/Unit/LoggedRequestTest.php +++ b/tests/Unit/LoggedRequestTest.php @@ -4,10 +4,11 @@ use App\Logger\LoggedRequest; use GuzzleHttp\Psr7\Request; -use function GuzzleHttp\Psr7\str; use Laminas\Http\Request as LaminasRequest; use Tests\TestCase; +use function GuzzleHttp\Psr7\str; + class LoggedRequestTest extends TestCase { /** @test */ diff --git a/tests/Unit/RequestLoggerTest.php b/tests/Unit/RequestLoggerTest.php index d824f0f..bf6a752 100644 --- a/tests/Unit/RequestLoggerTest.php +++ b/tests/Unit/RequestLoggerTest.php @@ -6,12 +6,13 @@ use App\Logger\RequestLogger; use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Response; -use function GuzzleHttp\Psr7\str; use Laminas\Http\Request as LaminasRequest; use Mockery as m; use React\Http\Browser; use Tests\TestCase; +use function GuzzleHttp\Psr7\str; + class RequestLoggerTest extends TestCase { /** @test */