From 815dae7f2fac5313b0a0bae4f437b6dd3de582f6 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sun, 5 Sep 2021 20:11:34 +0100 Subject: [PATCH] Support PHP 8.1 (#2929) --- .github/workflows/ci.yml | 22 ++++++++++++++-------- src/Handler/MockHandler.php | 1 + 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94652bbf3..af30cc7c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: uses: actions/checkout@v2 - name: Download dependencies - run: composer update --no-interaction --no-progress --prefer-stable --prefer-lowest --prefer-dist + run: composer update --no-interaction --no-progress --prefer-stable --prefer-lowest - name: Run tests run: make test @@ -42,15 +42,13 @@ jobs: strategy: max-parallel: 10 matrix: - php: ['7.2', '7.3', '7.4', '8.0'] - psr7: ['^1.7'] + php: ['7.2', '7.3', '7.4', '8.0', '8.1'] + psr7: ['^1.7', '^2.0'] include: - php: '7.4' psr7: '^1.7@dev' - php: '7.4' psr7: '^2.0@dev' - - php: '7.4' - psr7: '^2.0@beta' steps: - name: Set up PHP @@ -71,10 +69,14 @@ jobs: - name: Checkout code uses: actions/checkout@v2 + - name: Mimic PHP 8.0 + run: composer config platform.php 8.0.999 + if: matrix.php > 8 + - name: Download dependencies run: | composer require --no-update "guzzlehttp/psr7:${{ matrix.psr7 }}" - composer update --no-interaction --no-progress --prefer-dist + composer update --no-interaction --no-progress - name: Run tests run: make test @@ -85,7 +87,7 @@ jobs: strategy: max-parallel: 10 matrix: - php: ['7.2', '7.3', '7.4', '8.0'] + php: ['7.2', '7.3', '7.4', '8.0', '8.1'] steps: - name: Set up PHP @@ -106,8 +108,12 @@ jobs: - name: Checkout code uses: actions/checkout@v2 + - name: Mimic PHP 8.0 + run: composer config platform.php 8.0.999 + if: matrix.php > 8 + - name: Download dependencies - run: composer update --no-interaction --no-progress --prefer-dist + run: composer update --no-interaction --no-progress - name: Start test servers shell: bash diff --git a/src/Handler/MockHandler.php b/src/Handler/MockHandler.php index 79664e279..10749bd45 100644 --- a/src/Handler/MockHandler.php +++ b/src/Handler/MockHandler.php @@ -183,6 +183,7 @@ public function getLastOptions(): array /** * Returns the number of remaining items in the queue. */ + #[\ReturnTypeWillChange] public function count(): int { return \count($this->queue);