diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e29b9a6bc..7b78f4dca2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,11 +17,13 @@ jobs: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: php: - '7.3' - '7.4' - '8.0' + - '8.1' laravel: - 6.* - 7.* @@ -32,15 +34,27 @@ jobs: include: - laravel: '6.*' testbench: '4.*' + phpunit: '^8.5.8|^9.3.3' - laravel: '7.*' testbench: '5.*' + phpunit: '^8.5.8|^9.3.3' - laravel: '8.*' testbench: '6.*' + phpunit: '^9.3.3' exclude: - php: '8.0' laravel: 6.* + prefer: 'prefer-lowest' - php: '8.0' laravel: 7.* + prefer: 'prefer-lowest' + - php: '8.1' + laravel: 6.* + - php: '8.1' + laravel: 7.* + - php: '8.1' + laravel: 8.* + prefer: 'prefer-lowest' name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} --${{ matrix.prefer }} @@ -67,7 +81,7 @@ jobs: - name: Install dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench-browser-kit:${{ matrix.testbench }}" "orchestra/database:${{ matrix.testbench }}" --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" "phpunit/phpunit:${{ matrix.phpunit }}" "orchestra/testbench-browser-kit:${{ matrix.testbench }}" "orchestra/database:${{ matrix.testbench }}" --no-interaction --no-update composer update --${{ matrix.prefer }} --prefer-dist --no-interaction --no-suggest - name: Run tests for Local diff --git a/composer.json b/composer.json index 1894b867d7..38322cc4ca 100644 --- a/composer.json +++ b/composer.json @@ -30,10 +30,10 @@ ], "require": { "cboden/ratchet": "^0.4.1", - "clue/redis-react": "^2.3", + "clue/redis-react": "^2.5", "evenement/evenement": "^2.0|^3.0", "facade/ignition-contracts": "^1.0", - "guzzlehttp/psr7": "^1.5|^2.0", + "guzzlehttp/psr7": "^1.7|^2.0", "illuminate/broadcasting": "^6.3|^7.0|^8.0", "illuminate/console": "^6.3|^7.0|^8.0", "illuminate/http": "^6.3|^7.0|^8.0", @@ -41,15 +41,15 @@ "illuminate/routing": "^6.3|^7.0|^8.0", "illuminate/support": "^6.3|^7.0|^8.0", "pusher/pusher-php-server": "^3.0|^4.0|^5.0|^6.0|^7.0", - "react/promise": "^2.0", - "symfony/http-kernel": "^4.0|^5.0", + "react/promise": "^2.8", + "symfony/http-kernel": "^4.4|^5.4", "symfony/psr-http-message-bridge": "^1.1|^2.0" }, "require-dev": { "clue/block-react": "^1.4", "laravel/legacy-factories": "^1.1", "orchestra/testbench-browser-kit": "^4.0|^5.0|^6.0", - "phpunit/phpunit": "^8.0|^9.0" + "phpunit/phpunit": "^8.5.8|^9.3.3" }, "suggest": { "ext-pcntl": "Running the server needs pcntl to listen to command signals and soft-shutdown.", diff --git a/src/API/Controller.php b/src/API/Controller.php index 965b16d993..4647ad4534 100644 --- a/src/API/Controller.php +++ b/src/API/Controller.php @@ -6,6 +6,7 @@ use BeyondCode\LaravelWebSockets\Contracts\ChannelManager; use BeyondCode\LaravelWebSockets\Server\QueryParameters; use Exception; +use GuzzleHttp\Psr7\Message; use GuzzleHttp\Psr7\Response; use GuzzleHttp\Psr7\ServerRequest; use Illuminate\Http\JsonResponse; @@ -139,7 +140,7 @@ public function onError(ConnectionInterface $connection, Exception $exception) 'error' => $exception->getMessage(), ])); - tap($connection)->send(\GuzzleHttp\Psr7\str($response))->close(); + tap($connection)->send(Message::toString($response))->close(); } /** diff --git a/src/Dashboard/Http/Controllers/SendMessage.php b/src/Dashboard/Http/Controllers/SendMessage.php index 781cbaf01b..bad161d05c 100644 --- a/src/Dashboard/Http/Controllers/SendMessage.php +++ b/src/Dashboard/Http/Controllers/SendMessage.php @@ -4,8 +4,8 @@ use BeyondCode\LaravelWebSockets\Concerns\PushesToPusher; use BeyondCode\LaravelWebSockets\Rules\AppId; -use Exception; use Illuminate\Http\Request; +use Throwable; class SendMessage { @@ -42,7 +42,7 @@ public function __invoke(Request $request) $request->event, $decodedData ?: [] ); - } catch (Exception $e) { + } catch (Throwable $e) { return response()->json([ 'ok' => false, 'exception' => $e->getMessage(), diff --git a/src/Server/HealthHandler.php b/src/Server/HealthHandler.php index 73186c4fd2..949cc337ea 100644 --- a/src/Server/HealthHandler.php +++ b/src/Server/HealthHandler.php @@ -3,6 +3,7 @@ namespace BeyondCode\LaravelWebSockets\Server; use Exception; +use GuzzleHttp\Psr7\Message; use GuzzleHttp\Psr7\Response; use Psr\Http\Message\RequestInterface; use Ratchet\ConnectionInterface; @@ -25,7 +26,7 @@ public function onOpen(ConnectionInterface $connection, RequestInterface $reques json_encode(['ok' => true]) ); - tap($connection)->send(\GuzzleHttp\Psr7\str($response))->close(); + tap($connection)->send(Message::toString($response))->close(); } /**