diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbb38c8..8975414 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.1 extensions: intl, mbstring, pcre tools: prestissimo coverage: none @@ -46,7 +46,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.1 extensions: intl, mbstring, pcre tools: prestissimo coverage: none @@ -71,7 +71,7 @@ jobs: strategy: fail-fast: false matrix: - php: [7.1, 7.2, 7.3, 7.4, 8.0] + php: [7.1, 7.2, 7.3, 7.4, 8.0, 8.1] steps: - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -92,6 +92,29 @@ jobs: - name: Run the unit tests run: vendor/bin/phpunit --colors=always + php82: + name: PHP 8.2 + runs-on: ubuntu-latest + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + extensions: intl, mbstring, pcre + tools: prestissimo + coverage: none + + - name: Checkout + uses: actions/checkout@v2 + + - name: Install the dependencies + run: | + composer remove --dev --no-update contao/* phpstan/* psalm/* slam/* vimeo/* + composer install --no-interaction --no-suggest --ignore-platform-req=php + + - name: Run the unit tests + run: vendor/bin/phpunit --colors=always + prefer-lowest: name: Prefer Lowest runs-on: ubuntu-latest @@ -164,11 +187,15 @@ jobs: windows: name: Windows runs-on: windows-latest + strategy: + fail-fast: false + matrix: + php: [7.1, 7.2, 7.3, 7.4, 8.0, 8.1] steps: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: ${{ matrix.php }} extensions: intl, mbstring, pcre ini-values: memory_limit=1G tools: prestissimo diff --git a/composer.json b/composer.json index f89f3a6..4606e28 100644 --- a/composer.json +++ b/composer.json @@ -55,5 +55,10 @@ "unit-tests": [ "vendor/bin/phpunit --colors=always" ] + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } } } diff --git a/ecs.php b/ecs.php index 7bcad47..d667fc8 100644 --- a/ecs.php +++ b/ecs.php @@ -4,6 +4,7 @@ use PhpCsFixer\Fixer\Comment\HeaderCommentFixer; use PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer; +use PhpCsFixer\Fixer\FunctionNotation\UseArrowFunctionsFixer; use PhpCsFixer\Fixer\Operator\NewWithBracesFixer; use PhpCsFixer\Fixer\PhpUnit\PhpUnitExpectationFixer; use SlevomatCodingStandard\Sniffs\Variables\UselessVariableSniff; @@ -20,6 +21,7 @@ NewWithBracesFixer::class => null, UselessVariableSniff::class => null, PhpUnitExpectationFixer::class => null, + UseArrowFunctionsFixer::class, ]); $services = $containerConfigurator->services(); diff --git a/tests/SlugOptionsTest.php b/tests/SlugOptionsTest.php index 3fb09b6..2f7fc62 100644 --- a/tests/SlugOptionsTest.php +++ b/tests/SlugOptionsTest.php @@ -280,9 +280,7 @@ public function testAddTransformThrows($transform, string $expectedException): v { $options = new SlugOptions(['transforms' => []]); - if ($expectedException) { - $this->expectException($expectedException); - } + $this->expectException($expectedException); $this->assertSame([$transform], $options->addTransform($transform)->getTransforms()); }