From 6bf5a8fa48eb5d45de0bd5027936796947acfcbc Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Sat, 9 Mar 2024 20:41:32 +0100 Subject: [PATCH] Support Laravel 11 (#436) * Update composer.json * Tweak testsuite * Tweak testsuite * Tweak testsuite * Tweak testsuite --- .github/workflows/ci.yml | 64 ++++++++------------------------------ composer.json | 12 +++---- phpunit.xml | 25 --------------- tests/Node/GetAttrTest.php | 2 +- 4 files changed, 20 insertions(+), 83 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0bf199a..accc7d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,33 +11,11 @@ jobs: strategy: fail-fast: true matrix: - php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ] - laravel: [ '6', '7', '8', '9', '10' ] + php: [ '8.1', '8.2', '8.3'] + laravel: [ '9', '10', '11' ] exclude: - - php: '7.2' - laravel: '8' - - php: '7.2' - laravel: '9' - - php: '7.3' - laravel: '9' - - php: '7.4' - laravel: '9' - - php: '8.1' - laravel: '6' - - php: '8.1' - laravel: '7' - - php: '8.2' - laravel: '6' - - php: '8.2' - laravel: '7' - - php: '7.2' - laravel: '10' - - php: '7.3' - laravel: '10' - - php: '7.4' - laravel: '10' - - php: '8.0' - laravel: '10' + - laravel: 11 + php: 8.1 name: PHP ${{ matrix.php }}; Laravel ${{ matrix.laravel }} @@ -55,30 +33,6 @@ jobs: - name: Setup Problem Matchers run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Select Laravel 6 - uses: nick-invision/retry@v1 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer require "laravel/framework:6.*" "phpunit/phpunit:^8.5.8|^9.3.7" --no-update --no-interaction - if: "matrix.laravel == '6'" - - - name: Select Laravel 7 - uses: nick-invision/retry@v1 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer require "laravel/framework:7.*" "phpunit/phpunit:^8.5.8|^9.3.7" --no-update --no-interaction - if: "matrix.laravel == '7'" - - - name: Select Laravel 8 - uses: nick-invision/retry@v1 - with: - timeout_minutes: 5 - max_attempts: 5 - command: composer require "laravel/framework:8.*" "phpunit/phpunit:^9.3.7" --no-update --no-interaction - if: "matrix.laravel == '8'" - - name: Select Laravel 9 uses: nick-invision/retry@v1 with: @@ -95,6 +49,14 @@ jobs: command: composer require "laravel/framework:10.*" "phpunit/phpunit:^9.3.7" --no-update --no-interaction if: "matrix.laravel == '10'" + - name: Select Laravel 11 + uses: nick-invision/retry@v1 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer require "laravel/framework:11.*" "phpunit/phpunit:^9.3.7" --no-update --no-interaction + if: "matrix.laravel == '11'" + - name: Install PHP Dependencies uses: nick-invision/retry@v1 with: @@ -106,7 +68,7 @@ jobs: run: ./vendor/bin/phpunit --coverage-clover clover.xml - name: Execute code style checks - run: ./vendor/bin/phpcs --standard=PSR2 -p --ignore=./tests/storage/* --report=full --report-checkstyle=build/logs/checkstyle.xml src/ tests/ + run: ./vendor/bin/phpcs --standard=PSR2 -p --ignore=./tests/storage/* src/ tests/ - name: Check code coverage if: ${{ matrix.php == '8.1' }} diff --git a/composer.json b/composer.json index 13e3a1f..8b259ef 100644 --- a/composer.json +++ b/composer.json @@ -14,21 +14,21 @@ } ], "require": { - "php": "^7.2.5 || ^8.0", + "php": "^8.1", "twig/twig": "~3.0", - "illuminate/support": "^6|^7|^8|^9|^10", - "illuminate/view": "^6|^7|^8|^9|^10" + "illuminate/support": "^9|^10|^11", + "illuminate/view": "^9|^10|^11" }, "require-dev": { "ext-json": "*", - "laravel/framework": "^6|^7|^8|^9|^10", + "laravel/framework": "^9|^10|^11", "mockery/mockery": "^1.3.1", - "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.7", + "phpunit/phpunit": "^8.5.8 || ^9.3.7", "squizlabs/php_codesniffer": "^3.6" }, "suggest": { "twig/extensions": "~1.0", - "laravelcollective/html": "For bringing back html/form in Laravel 5.x" + "laravelcollective/html": "For bringing back html/form in Laravel" }, "autoload": { "psr-4": { diff --git a/phpunit.xml b/phpunit.xml index 0dc1b28..4e92ed0 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -14,30 +14,5 @@ ./tests/ - - - ./src - - ./src/config - - - - - - - - - - diff --git a/tests/Node/GetAttrTest.php b/tests/Node/GetAttrTest.php index 1312ee3..8deffb5 100644 --- a/tests/Node/GetAttrTest.php +++ b/tests/Node/GetAttrTest.php @@ -137,7 +137,7 @@ public function getTests() $tests[] = [ $node, sprintf( - '%s%s, "bar", [0 => %s, 1 => "bar"], "method", false, false, false, 1)', + '%s%s, "bar", [%s, "bar"], "method", false, false, false, 1)', $this->getAttributeGetter(), $this->getVariableGetter('foo', 1), $this->getVariableGetter('foo')