From 6a126c2bb3c4ac8676d6f6b4c8e2134d86468c02 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Sat, 10 Aug 2024 14:18:46 +0200 Subject: [PATCH] Fix and add lowest run --- .github/workflows/ci.yml | 8 +++++++- src/Psalm/Internal/BCHelper.php | 2 +- tests/fixtures/SuicidalAutoloader/autoloader.php | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d1103373cb..af399691596 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,7 +115,7 @@ jobs: echo "chunks=$(php -r 'echo json_encode(range(1, ${{ env.CHUNK_COUNT }} ));')" >> $GITHUB_OUTPUT tests: - name: "Unit Tests - PHP ${{ matrix.php-version }} ${{ matrix.chunk }}/${{ matrix.count }}" + name: "Unit Tests - PHP ${{ matrix.php-version }} ${{ matrix.dependencies }} ${{ matrix.chunk }}/${{ matrix.count }}" runs-on: ubuntu-latest needs: @@ -129,8 +129,14 @@ jobs: - "8.1" - "8.2" - "8.3" + dependencies: [highest] count: ${{ fromJson(needs.chunk-matrix.outputs.count) }} chunk: ${{ fromJson(needs.chunk-matrix.outputs.chunks) }} + include: + - php-version: 8.0 + dependencies: lowest + count: ${{ fromJson(needs.chunk-matrix.outputs.count) }} + chunk: ${{ fromJson(needs.chunk-matrix.outputs.chunks) }} env: CHUNK_COUNT: "${{ matrix.count }}" diff --git a/src/Psalm/Internal/BCHelper.php b/src/Psalm/Internal/BCHelper.php index 51332ef8408..316148d96e4 100644 --- a/src/Psalm/Internal/BCHelper.php +++ b/src/Psalm/Internal/BCHelper.php @@ -38,7 +38,7 @@ public static function getPHPParserClassName(string $className): string public static function usePHPParserV4(): bool { - return class_exists('\PhpParser\Node\Stmt\Throw'); + return class_exists('\PhpParser\Node\Stmt\Throw_'); } public static function isThrow(Node $stmt): bool diff --git a/tests/fixtures/SuicidalAutoloader/autoloader.php b/tests/fixtures/SuicidalAutoloader/autoloader.php index d31e8da0747..d34cd51831b 100644 --- a/tests/fixtures/SuicidalAutoloader/autoloader.php +++ b/tests/fixtures/SuicidalAutoloader/autoloader.php @@ -18,7 +18,7 @@ 'PHPUnit\Framework\DOMElement', 'Stringable', 'AllowDynamicProperties', - 'PhpParser\Node\Stmt\Throw', // BCHelper for nikic/php-parser v4/5 + 'PhpParser\Node\Stmt\Throw_', // BCHelper for nikic/php-parser v4/5 // https://github.com/symfony/symfony/pull/40203 // these are actually functions, referenced as `if (!function_exists(u::class))`