Skip to content

Commit

Permalink
Merge pull request #379 from beyondcode/analysis-madDvp
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
mpociot authored Apr 26, 2023
2 parents 6405cb6 + 9507fbe commit c9ec4e6
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 15 deletions.
3 changes: 2 additions & 1 deletion app/Client/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion app/Client/Http/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -16,6 +15,8 @@
use React\Http\Browser;
use React\Socket\Connector;

use function GuzzleHttp\Psr7\parse_request;

class HttpClient
{
/** @var LoopInterface */
Expand Down
3 changes: 2 additions & 1 deletion app/Client/ProxyManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/Concerns/LoadsViews.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [])
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion app/Logger/LoggedRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 */
Expand Down
3 changes: 2 additions & 1 deletion app/Server/Http/Controllers/ControlMessageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
3 changes: 2 additions & 1 deletion app/Server/Http/Controllers/TunnelMessageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
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;
use Ratchet\ConnectionInterface;
use Ratchet\RFC6455\Messaging\Frame;
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;

use function GuzzleHttp\Psr7\str;

class TunnelMessageController extends Controller
{
/** @var ConnectionManager */
Expand Down
7 changes: 4 additions & 3 deletions app/Server/Http/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
}
Expand Down
3 changes: 2 additions & 1 deletion tests/Feature/Client/DashboardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -18,6 +17,8 @@
use React\Http\Message\ResponseException;
use Tests\Feature\TestCase;

use function GuzzleHttp\Psr7\str;

class DashboardTest extends TestCase
{
/** @var Browser */
Expand Down
3 changes: 2 additions & 1 deletion tests/Feature/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion tests/Unit/LoggedRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
3 changes: 2 additions & 1 deletion tests/Unit/RequestLoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit c9ec4e6

Please sign in to comment.