Apply fixes from StyleCI

This commit is contained in:
StyleCI Bot
2022-03-04 14:53:40 +00:00
parent 4e2eda036a
commit e375d21e4c
5 changed files with 14 additions and 14 deletions

View File

@@ -127,7 +127,7 @@ class Client
$this->logger->info($data->message); $this->logger->info($data->message);
$this->logger->info("Local-URL:\t\t<options=bold>{$sharedUrl}</>"); $this->logger->info("Local-URL:\t\t<options=bold>{$sharedUrl}</>");
$this->logger->info("Dashboard-URL:\t\t<options=bold>http://127.0.0.1:".config()->get('expose.dashboard_port')."</>"); $this->logger->info("Dashboard-URL:\t\t<options=bold>http://127.0.0.1:".config()->get('expose.dashboard_port').'</>');
$this->logger->info("Expose-URL:\t\t<options=bold>http://{$data->subdomain}.{$host}{$httpPort}</>"); $this->logger->info("Expose-URL:\t\t<options=bold>http://{$data->subdomain}.{$host}{$httpPort}</>");
$this->logger->info("Expose-URL:\t\t<options=bold>https://{$data->subdomain}.{$host}</>"); $this->logger->info("Expose-URL:\t\t<options=bold>https://{$data->subdomain}.{$host}</>");
$this->logger->line(''); $this->logger->line('');

View File

@@ -2,9 +2,9 @@
namespace App\Client\Support; namespace App\Client\Support;
use Symfony\Component\Console\Output\StreamOutput;
use Symfony\Component\Console\Formatter\OutputFormatterInterface; use Symfony\Component\Console\Formatter\OutputFormatterInterface;
use Symfony\Component\Console\Helper\Helper; use Symfony\Component\Console\Helper\Helper;
use Symfony\Component\Console\Output\StreamOutput;
use Symfony\Component\Console\Terminal; use Symfony\Component\Console\Terminal;
/** /**
@@ -19,8 +19,8 @@ class ConsoleSectionOutput extends StreamOutput
private $terminal; private $terminal;
/** /**
* @param resource $stream * @param resource $stream
* @param \Symfony\Component\Console\Output\ConsoleSectionOutput[] $sections * @param \Symfony\Component\Console\Output\ConsoleSectionOutput[] $sections
*/ */
public function __construct($stream, array &$sections, int $verbosity, bool $decorated, OutputFormatterInterface $formatter) 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. * 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) public function clear(int $lines = null)
{ {
if (empty($this->content) || !$this->isDecorated()) { if (empty($this->content) || ! $this->isDecorated()) {
return; return;
} }
@@ -56,7 +56,7 @@ class ConsoleSectionOutput extends StreamOutput
/** /**
* Overwrites the previous output with a new message. * Overwrites the previous output with a new message.
* *
* @param array|string $message * @param array|string $message
*/ */
public function overwrite($message) public function overwrite($message)
{ {
@@ -86,7 +86,7 @@ class ConsoleSectionOutput extends StreamOutput
*/ */
protected function doWrite(string $message, bool $newline) protected function doWrite(string $message, bool $newline)
{ {
if (!$this->isDecorated()) { if (! $this->isDecorated()) {
parent::doWrite($message, $newline); parent::doWrite($message, $newline);
return; return;

View File

@@ -12,7 +12,6 @@ use App\Server\Exceptions\NoFreePortAvailable;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Ratchet\ConnectionInterface; use Ratchet\ConnectionInterface;
use Ratchet\WebSocket\MessageComponentInterface; use Ratchet\WebSocket\MessageComponentInterface;
use React\EventLoop\LoopInterface;
use React\Promise\Deferred; use React\Promise\Deferred;
use React\Promise\PromiseInterface; use React\Promise\PromiseInterface;
use function React\Promise\reject; 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(); $deferred = new Deferred();
$connectionMessageResolver = config('expose.admin.messages.resolve_connection_message')($connectionInfo, $user); $connectionMessageResolver = config('expose.admin.messages.resolve_connection_message')($connectionInfo, $user);
@@ -163,6 +163,7 @@ class ControlMessageController implements MessageComponentInterface
}); });
} else { } else {
$connectionInfo->message = $connectionMessageResolver; $connectionInfo->message = $connectionMessageResolver;
return \React\Promise\resolve($connectionInfo); return \React\Promise\resolve($connectionInfo);
} }
@@ -188,7 +189,7 @@ class ControlMessageController implements MessageComponentInterface
return $this->resolveConnectionMessage($connectionInfo, $user); return $this->resolveConnectionMessage($connectionInfo, $user);
}) })
->then(function ($connectionInfo) use ($data, $connection, $user) { ->then(function ($connectionInfo) use ($connection, $user) {
$connection->send(json_encode([ $connection->send(json_encode([
'event' => 'authenticated', 'event' => 'authenticated',
'data' => [ 'data' => [

View File

@@ -2,9 +2,9 @@
namespace App\Server\Support; namespace App\Server\Support;
use Clue\React\Buzz\Browser;
use Exception; use Exception;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use Clue\React\Buzz\Browser;
class RetrieveWelcomeMessageFromApi class RetrieveWelcomeMessageFromApi
{ {
@@ -24,7 +24,7 @@ class RetrieveWelcomeMessageFromApi
public function forUser($user) public function forUser($user)
{ {
return $this->browser return $this->browser
->get($this->url . '?' . http_build_query($user), [ ->get($this->url.'?'.http_build_query($user), [
'Accept' => 'application/json', 'Accept' => 'application/json',
]) ])
->then(function (ResponseInterface $response) { ->then(function (ResponseInterface $response) {

View File

@@ -91,7 +91,6 @@ class ApiTest extends TestCase
$this->assertSame('Marcel', $user->name); $this->assertSame('Marcel', $user->name);
$this->assertSame(1, $user->can_specify_subdomains); $this->assertSame(1, $user->can_specify_subdomains);
$this->await($this->browser->post('http://127.0.0.1:8080/api/users', [ $this->await($this->browser->post('http://127.0.0.1:8080/api/users', [
'Host' => 'expose.localhost', 'Host' => 'expose.localhost',
'Authorization' => base64_encode('username:secret'), 'Authorization' => base64_encode('username:secret'),