From e375d21e4c19d34b78164582e599c88a8a93783e Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Fri, 4 Mar 2022 14:53:40 +0000 Subject: [PATCH] Apply fixes from StyleCI --- app/Client/Client.php | 2 +- app/Client/Support/ConsoleSectionOutput.php | 14 +++++++------- .../Http/Controllers/ControlMessageController.php | 7 ++++--- .../Support/RetrieveWelcomeMessageFromApi.php | 4 ++-- tests/Feature/Server/ApiTest.php | 1 - 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/Client/Client.php b/app/Client/Client.php index b6eeab2..39627ed 100644 --- a/app/Client/Client.php +++ b/app/Client/Client.php @@ -127,7 +127,7 @@ class Client $this->logger->info($data->message); $this->logger->info("Local-URL:\t\t{$sharedUrl}"); - $this->logger->info("Dashboard-URL:\t\thttp://127.0.0.1:".config()->get('expose.dashboard_port').""); + $this->logger->info("Dashboard-URL:\t\thttp://127.0.0.1:".config()->get('expose.dashboard_port').''); $this->logger->info("Expose-URL:\t\thttp://{$data->subdomain}.{$host}{$httpPort}"); $this->logger->info("Expose-URL:\t\thttps://{$data->subdomain}.{$host}"); $this->logger->line(''); diff --git a/app/Client/Support/ConsoleSectionOutput.php b/app/Client/Support/ConsoleSectionOutput.php index 16373bd..aeaf09e 100644 --- a/app/Client/Support/ConsoleSectionOutput.php +++ b/app/Client/Support/ConsoleSectionOutput.php @@ -2,9 +2,9 @@ namespace App\Client\Support; -use Symfony\Component\Console\Output\StreamOutput; use Symfony\Component\Console\Formatter\OutputFormatterInterface; use Symfony\Component\Console\Helper\Helper; +use Symfony\Component\Console\Output\StreamOutput; use Symfony\Component\Console\Terminal; /** @@ -19,8 +19,8 @@ class ConsoleSectionOutput extends StreamOutput private $terminal; /** - * @param resource $stream - * @param \Symfony\Component\Console\Output\ConsoleSectionOutput[] $sections + * @param resource $stream + * @param \Symfony\Component\Console\Output\ConsoleSectionOutput[] $sections */ public function __construct($stream, array &$sections, int $verbosity, bool $decorated, OutputFormatterInterface $formatter) { @@ -33,11 +33,11 @@ class ConsoleSectionOutput extends StreamOutput /** * Clears previous output for this section. * - * @param int $lines Number of lines to clear. If null, then the entire output of this section is cleared + * @param int $lines Number of lines to clear. If null, then the entire output of this section is cleared */ public function clear(int $lines = null) { - if (empty($this->content) || !$this->isDecorated()) { + if (empty($this->content) || ! $this->isDecorated()) { return; } @@ -56,7 +56,7 @@ class ConsoleSectionOutput extends StreamOutput /** * Overwrites the previous output with a new message. * - * @param array|string $message + * @param array|string $message */ public function overwrite($message) { @@ -86,7 +86,7 @@ class ConsoleSectionOutput extends StreamOutput */ protected function doWrite(string $message, bool $newline) { - if (!$this->isDecorated()) { + if (! $this->isDecorated()) { parent::doWrite($message, $newline); return; diff --git a/app/Server/Http/Controllers/ControlMessageController.php b/app/Server/Http/Controllers/ControlMessageController.php index 488ce8c..65e1760 100644 --- a/app/Server/Http/Controllers/ControlMessageController.php +++ b/app/Server/Http/Controllers/ControlMessageController.php @@ -12,7 +12,6 @@ use App\Server\Exceptions\NoFreePortAvailable; use Illuminate\Support\Arr; use Ratchet\ConnectionInterface; use Ratchet\WebSocket\MessageComponentInterface; -use React\EventLoop\LoopInterface; use React\Promise\Deferred; use React\Promise\PromiseInterface; use function React\Promise\reject; @@ -151,7 +150,8 @@ class ControlMessageController implements MessageComponentInterface }); } - protected function resolveConnectionMessage($connectionInfo, $user) { + protected function resolveConnectionMessage($connectionInfo, $user) + { $deferred = new Deferred(); $connectionMessageResolver = config('expose.admin.messages.resolve_connection_message')($connectionInfo, $user); @@ -163,6 +163,7 @@ class ControlMessageController implements MessageComponentInterface }); } else { $connectionInfo->message = $connectionMessageResolver; + return \React\Promise\resolve($connectionInfo); } @@ -188,7 +189,7 @@ class ControlMessageController implements MessageComponentInterface return $this->resolveConnectionMessage($connectionInfo, $user); }) - ->then(function ($connectionInfo) use ($data, $connection, $user) { + ->then(function ($connectionInfo) use ($connection, $user) { $connection->send(json_encode([ 'event' => 'authenticated', 'data' => [ diff --git a/app/Server/Support/RetrieveWelcomeMessageFromApi.php b/app/Server/Support/RetrieveWelcomeMessageFromApi.php index dc8f6fe..677e2be 100644 --- a/app/Server/Support/RetrieveWelcomeMessageFromApi.php +++ b/app/Server/Support/RetrieveWelcomeMessageFromApi.php @@ -2,9 +2,9 @@ namespace App\Server\Support; +use Clue\React\Buzz\Browser; use Exception; use Psr\Http\Message\ResponseInterface; -use Clue\React\Buzz\Browser; class RetrieveWelcomeMessageFromApi { @@ -24,7 +24,7 @@ class RetrieveWelcomeMessageFromApi public function forUser($user) { return $this->browser - ->get($this->url . '?' . http_build_query($user), [ + ->get($this->url.'?'.http_build_query($user), [ 'Accept' => 'application/json', ]) ->then(function (ResponseInterface $response) { diff --git a/tests/Feature/Server/ApiTest.php b/tests/Feature/Server/ApiTest.php index 12b8bbe..f8454c9 100644 --- a/tests/Feature/Server/ApiTest.php +++ b/tests/Feature/Server/ApiTest.php @@ -91,7 +91,6 @@ class ApiTest extends TestCase $this->assertSame('Marcel', $user->name); $this->assertSame(1, $user->can_specify_subdomains); - $this->await($this->browser->post('http://127.0.0.1:8080/api/users', [ 'Host' => 'expose.localhost', 'Authorization' => base64_encode('username:secret'),