From e7c4cf4afebb777e3b76f7dcaaf62aa03333ace5 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 21 Nov 2024 23:05:29 +0800 Subject: [PATCH] [1.x] Supports PHP 8.4 (#419) * [1.x] Supports PHP 8.4 * wip Signed-off-by: Mior Muhammad Zaki * wip Signed-off-by: Mior Muhammad Zaki --------- Signed-off-by: Mior Muhammad Zaki --- .github/workflows/tests.yml | 31 +++++++++++++++++++++++++------ src/Storage/DatabaseStorage.php | 2 ++ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f5f08892..65775923 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,6 +36,10 @@ jobs: php: [8.1, 8.2, 8.3] laravel: [10, 11] stability: [prefer-lowest, prefer-stable] + include: + - php: 8.4 + laravel: 11 + stability: prefer-stable name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - Stability ${{ matrix.stability }} - MySQL 5.7 @@ -55,9 +59,13 @@ jobs: - name: Install redis-cli run: sudo apt-get install -qq redis-tools - - name: Install dependencies + - name: Require cachewerk/relay run: | composer require cachewerk/relay --no-interaction --no-update + if: matrix.php != 8.4 + + - name: Install dependencies + run: | composer update --prefer-dist --no-interaction --no-progress --${{ matrix.stability }} - name: Execute tests @@ -114,9 +122,13 @@ jobs: - name: Install redis-cli run: sudo apt-get install -qq redis-tools - - name: Install dependencies + - name: Require cachewerk/relay run: | composer require cachewerk/relay --no-interaction --no-update + if: matrix.php != 8.4 + + - name: Install dependencies + run: | composer update --prefer-dist --no-interaction --no-progress --${{ matrix.stability }} - name: Execute tests @@ -171,11 +183,14 @@ jobs: - name: Install redis-cli run: sudo apt-get install -qq redis-tools - - name: Install dependencies + - name: Require cachewerk/relay run: | - composer require "illuminate/contracts=^${{ matrix.laravel }}" --dev --no-update composer require cachewerk/relay --no-interaction --no-update - composer update --prefer-dist --no-interaction --no-progress + if: matrix.php != 8.4 + + - name: Install dependencies + run: | + composer update --prefer-dist --no-interaction --no-progress --${{ matrix.stability }} --with="illuminate/contracts=^${{ matrix.laravel }}" - name: Execute tests run: vendor/bin/pest -vvv @@ -220,9 +235,13 @@ jobs: - name: Install redis-cli run: sudo apt-get install -qq redis-tools - - name: Install dependencies + - name: Require cachewerk/relay run: | composer require cachewerk/relay --no-interaction --no-update + if: matrix.php != 8.4 + + - name: Install dependencies + run: | composer update --prefer-dist --no-interaction --no-progress --${{ matrix.stability }} - name: Execute tests diff --git a/src/Storage/DatabaseStorage.php b/src/Storage/DatabaseStorage.php index 96795d96..3cabc64f 100644 --- a/src/Storage/DatabaseStorage.php +++ b/src/Storage/DatabaseStorage.php @@ -445,6 +445,7 @@ protected function periods(): array */ public function values(string $type, ?array $keys = null): Collection { + /** @phpstan-ignore return.type */ return $this->connection() ->table('pulse_values') ->select('timestamp', 'key', 'value') @@ -529,6 +530,7 @@ public function aggregate( $orderBy ??= $aggregates[0]; + /** @phpstan-ignore return.type */ return $this->connection() ->query() ->select([