Skip to content

Commit

Permalink
Fix and add lowest run
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Aug 10, 2024
1 parent e129b98 commit 80bc28f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -129,6 +129,9 @@ jobs:
- "8.1"
- "8.2"
- "8.3"
dependencies:
- highest
- lowest
count: ${{ fromJson(needs.chunk-matrix.outputs.count) }}
chunk: ${{ fromJson(needs.chunk-matrix.outputs.chunks) }}

Expand Down Expand Up @@ -158,12 +161,20 @@ jobs:
echo "files_cache=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "vcs_cache=$(composer config cache-vcs-dir)" >> $GITHUB_OUTPUT
- name: Generate composer.lock
- name: Generate highest composer.lock
if: ${{ matrix.dependencies == 'highest' }}
run: |
composer update --no-install
env:
COMPOSER_ROOT_VERSION: dev-master

- name: Generate lowest composer.lock
if: ${{ matrix.dependencies == 'lowest' }}
run: |
composer update --no-install --prefer-lowest
env:
COMPOSER_ROOT_VERSION: dev-master

- name: Cache composer cache
uses: actions/cache@v4
with:
Expand Down
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@
"require-dev": {
"ext-curl": "*",
"amphp/phpunit-util": "^2.0",
"bamarni/composer-bin-plugin": "^1.4",
"brianium/paratest": "^6.9",
"mockery/mockery": "^1.5",
"nunomaduro/mock-final-classes": "^1.1",
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/phpdoc-parser": "^1.6",
"phpunit/phpunit": "^9.6",
"bamarni/composer-bin-plugin": "^1.8",
"brianium/paratest": "^6.11",
"mockery/mockery": "^1.6",
"nunomaduro/mock-final-classes": "^1.2",
"php-parallel-lint/php-parallel-lint": "^1.4",
"phpstan/phpdoc-parser": "^1.29",
"phpunit/phpunit": "^9.6.20",
"psalm/plugin-mockery": "^1.1",
"psalm/plugin-phpunit": "^0.18",
"slevomat/coding-standard": "^8.4",
"squizlabs/php_codesniffer": "^3.6",
"slevomat/coding-standard": "^8.15",
"squizlabs/php_codesniffer": "^3.10",
"symfony/process": "^4.4 || ^5.0 || ^6.0 || ^7.0"
},
"suggest": {
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Internal/BCHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/SuicidalAutoloader/autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))`
Expand Down

0 comments on commit 80bc28f

Please sign in to comment.