Apply fixes from StyleCI

This commit is contained in:
Marcel Pociot
2020-06-17 10:35:07 +00:00
committed by StyleCI Bot
parent 0e33bc7d99
commit 83676deddb
56 changed files with 189 additions and 316 deletions

View File

@@ -5,16 +5,15 @@ namespace App\Server\Http\Controllers;
use App\Contracts\ConnectionManager;
use App\Contracts\UserRepository;
use App\Http\QueryParameters;
use Ratchet\ConnectionInterface;
use Ratchet\WebSocket\MessageComponentInterface;
use React\Promise\Deferred;
use React\Promise\FulfilledPromise;
use React\Promise\PromiseInterface;
use stdClass;
use Ratchet\ConnectionInterface;
class ControlMessageController implements MessageComponentInterface
{
/** @var ConnectionManager */
protected $connectionManager;
@@ -28,16 +27,16 @@ class ControlMessageController implements MessageComponentInterface
}
/**
* @inheritDoc
* {@inheritdoc}
*/
function onOpen(ConnectionInterface $connection)
public function onOpen(ConnectionInterface $connection)
{
}
/**
* @inheritDoc
* {@inheritdoc}
*/
function onClose(ConnectionInterface $connection)
public function onClose(ConnectionInterface $connection)
{
if (isset($connection->request_id)) {
$httpConnection = $this->connectionManager->getHttpConnectionForRequestId($connection->request_id);
@@ -48,9 +47,9 @@ class ControlMessageController implements MessageComponentInterface
}
/**
* @inheritDoc
* {@inheritdoc}
*/
function onMessage(ConnectionInterface $connection, $msg)
public function onMessage(ConnectionInterface $connection, $msg)
{
if (isset($connection->request_id)) {
return $this->sendResponseToHttpConnection($connection->request_id, $msg);
@@ -92,15 +91,15 @@ class ControlMessageController implements MessageComponentInterface
'data' => [
'message' => config('expose.admin.messages.message_of_the_day'),
'subdomain' => $connectionInfo->subdomain,
'client_id' => $connectionInfo->client_id
'client_id' => $connectionInfo->client_id,
],
]));
}, function () use ($connection) {
$connection->send(json_encode([
'event' => 'authenticationFailed',
'data' => [
'message' => config('expose.admin.messages.invalid_auth_token')
]
'message' => config('expose.admin.messages.invalid_auth_token'),
],
]));
$connection->close();
});
@@ -112,15 +111,15 @@ class ControlMessageController implements MessageComponentInterface
$connectionInfo = $this->connectionManager->findControlConnectionForClientId($data->client_id);
$connectionInfo->emit('proxy_ready_' . $data->request_id, [
$connectionInfo->emit('proxy_ready_'.$data->request_id, [
$connection,
]);
}
/**
* @inheritDoc
* {@inheritdoc}
*/
function onError(ConnectionInterface $conn, \Exception $e)
public function onError(ConnectionInterface $conn, \Exception $e)
{
//
}
@@ -150,9 +149,9 @@ class ControlMessageController implements MessageComponentInterface
protected function hasValidSubdomain(ConnectionInterface $connection, ?string $subdomain): bool
{
if (!is_null($subdomain)) {
if (! is_null($subdomain)) {
$controlConnection = $this->connectionManager->findControlConnectionForSubdomain($subdomain);
if (!is_null($controlConnection) || $subdomain === config('expose.admin.subdomain')) {
if (! is_null($controlConnection) || $subdomain === config('expose.admin.subdomain')) {
$message = config('expose.admin.messages.subdomain_taken');
$message = str_replace(':subdomain', $subdomain, $message);
@@ -160,7 +159,7 @@ class ControlMessageController implements MessageComponentInterface
'event' => 'subdomainTaken',
'data' => [
'message' => $message,
]
],
]));
$connection->close();