From 9507fbef790538c993d03434db02d3be654e2c0d Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Wed, 26 Apr 2023 11:30:39 +0000 Subject: [PATCH 1/3] 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 */ From 364fec65a2ea8fa0769beec6f03a248180f61723 Mon Sep 17 00:00:00 2001 From: Sebastian Schlein Date: Thu, 21 Dec 2023 13:25:39 +0100 Subject: [PATCH 2/3] add issue templates for better issue management --- .github/ISSUE_TEMPLATE/bug.yml | 52 ++++++++++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 8 +++++ .github/ISSUE_TEMPLATE/feature.yml | 21 ++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature.yml diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 0000000..20aad4e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,52 @@ +name: Bug Report +description: File a bug report +title: "[Bug]: " +labels: [] +body: + - type: markdown + attributes: + value: | + Before opening a bug report, please search for the behaviour in the existing issues. + + --- + + Thank you for taking the time to file a bug report. To address this bug as fast as possible, we need some information. + - type: dropdown + id: arch + attributes: + label: System architecture + description: "Which operating system architecture are you using?" + options: + - Mac, Intel (x86) + - Mac, ARM64 (M1, M2, etc) + - Windows + - Linux + validations: + required: true + - type: input + id: php + attributes: + label: PHP Version + description: "If your problem only occurs with a certain PHP version, please provide it in the field below." + placeholder: "PHP 8.2.8 (cli) (built: Jul 7 2023 00:11:29) (NTS)" + validations: + required: false + - type: textarea + id: bug-description + attributes: + label: Bug description + description: What happened and what did you expect to happen? + validations: + required: true + - type: textarea + id: steps + attributes: + label: Steps to reproduce + description: Which steps do we need to take to reproduce this error? + + - type: textarea + id: logs + attributes: + label: Relevant log output + description: If applicable, provide relevant log output. No need for backticks here. + render: shell diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..4b83ed6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Check the docs + url: https://expose.dev/docs/introduction + about: "This repository contains the open source version of Expose. Please contact our email support if you have issues with our network or Expose Pro!" + - name: Security vulnerabilities + url: https://@beyondco.de + about: If you want to report a security issue, please contact our support. diff --git a/.github/ISSUE_TEMPLATE/feature.yml b/.github/ISSUE_TEMPLATE/feature.yml new file mode 100644 index 0000000..d047840 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.yml @@ -0,0 +1,21 @@ +name: Feature Request +description: Propose a new feature for Herd +title: "[Feature Request]: " +labels: [feature request] +body: + - type: markdown + attributes: + value: | + Thank you for suggesting a feature for the Expose open source version! + - type: textarea + id: feature-description + attributes: + label: Feature Description + description: How should this feature look like? + validations: + required: true + - type: textarea + id: valuable + attributes: + label: Is this feature valuable for other users as well and why? + description: We want to build software that provides a great experience for all of us. From f82dd882a45e3db883fe7471c2b563ac57fe8487 Mon Sep 17 00:00:00 2001 From: Sebastian Schlein Date: Thu, 21 Dec 2023 13:32:06 +0100 Subject: [PATCH 3/3] fix typo --- .github/ISSUE_TEMPLATE/feature.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/feature.yml b/.github/ISSUE_TEMPLATE/feature.yml index d047840..b63c579 100644 --- a/.github/ISSUE_TEMPLATE/feature.yml +++ b/.github/ISSUE_TEMPLATE/feature.yml @@ -1,5 +1,5 @@ name: Feature Request -description: Propose a new feature for Herd +description: Propose a new feature for the open source version of Expose title: "[Feature Request]: " labels: [feature request] body: