diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 2c8cc64..b5ad2da 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -2,25 +2,30 @@ name: 'Unit Tests' on: push: - branches: [ main ] + branches: [ release-1.x ] pull_request: - branches: [ main ] + branches: [ release-1.x ] jobs: build-test: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + composer: [lowest, highest] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup PHP 8 uses: shivammathur/setup-php@v2 with: php-version: 8.1 - tools: composer:v2 + tools: none coverage: none - name: Composer Install - run: composer update --no-interaction --no-progress --ansi + uses: ramsey/composer-install@v2 + with: + dependency-versions: ${{ matrix.composer }} - name: Unit Tests run: ./vendor/bin/pest --colors=always \ No newline at end of file diff --git a/composer.json b/composer.json index aa70f39..a4a07d6 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ ], "require": { "php": "^8.1", - "nikic/php-parser": "^v4.14", + "nikic/php-parser": "^v4.18 || ^5.0", "cspray/typiphy": "^0.3" }, "require-dev": { diff --git a/src/PhpParserAnnotatedTargetParser.php b/src/PhpParserAnnotatedTargetParser.php index b3cc425..766b191 100644 --- a/src/PhpParserAnnotatedTargetParser.php +++ b/src/PhpParserAnnotatedTargetParser.php @@ -29,7 +29,7 @@ final class PhpParserAnnotatedTargetParser implements AnnotatedTargetParser { private readonly Parser $parser; public function __construct() { - $this->parser = (new ParserFactory())->create(ParserFactory::ONLY_PHP7); + $this->parser = (new ParserFactory())->createForNewestSupportedVersion(); } public function parse(AnnotatedTargetParserOptions $options) : Generator {