From d03601b013d24b7706f326a725b115f8057cffa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20L=C3=B8vgaard?= Date: Tue, 14 May 2024 12:01:18 +0200 Subject: [PATCH] Remove PHP 7.4 and PHP 8.0 support --- .editorconfig | 30 -------------------- .github/workflows/build.yaml | 54 +++++++++++++++++------------------- LICENSE | 2 +- composer.json | 4 +-- ecs.php | 7 ++--- 5 files changed, 31 insertions(+), 66 deletions(-) diff --git a/.editorconfig b/.editorconfig index e716f26..779f99a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,42 +1,12 @@ root = true [*] -# Change these settings to your own preference indent_style = space indent_size = 4 - -# We recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true - -[*.json] -indent_style = space -indent_size = 2 - [*.md] -indent_style = space -indent_size = 4 trim_trailing_whitespace = false - -[*.neon] -indent_style = tab -indent_size = 4 - -[*.php] -indent_style = space -indent_size = 4 - -[composer.json] -indent_style = space -indent_size = 4 - -[phpstan.neon] -indent_style = tab -indent_size = 4 - -[phpunit.xml{,.dist}] -indent_style = space -indent_size = 4 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4c7c290..c2c751b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,14 +15,14 @@ jobs: strategy: matrix: php-version: - - "7.4" + - "8.1" dependencies: - "highest" steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Setup PHP, with composer and extensions" uses: "shivammathur/setup-php@v2" @@ -32,7 +32,7 @@ jobs: coverage: "none" - name: "Install composer dependencies" - uses: "ramsey/composer-install@v2" + uses: "ramsey/composer-install@v3" with: dependency-versions: "${{ matrix.dependencies }}" @@ -53,17 +53,17 @@ jobs: strategy: matrix: php-version: - - "7.4" - - "8.0" - "8.1" - "8.2" + - "8.3" dependencies: + - "lowest" - "highest" steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Setup PHP, with composer and extensions" uses: "shivammathur/setup-php@v2" @@ -74,7 +74,7 @@ jobs: tools: "composer-require-checker, composer-unused" - name: "Install composer dependencies" - uses: "ramsey/composer-install@v2" + uses: "ramsey/composer-install@v3" with: dependency-versions: "${{ matrix.dependencies }}" @@ -82,7 +82,7 @@ jobs: run: "composer-require-checker check" - name: "Run composer-unused/composer-unused" - run: "composer-unused || true" # TODO Remove when https://github.com/shivammathur/setup-php/issues/703 is fixed + run: "composer-unused" static-code-analysis: name: "Static Code Analysis" @@ -92,17 +92,17 @@ jobs: strategy: matrix: php-version: - - "7.4" - - "8.0" - "8.1" - "8.2" + - "8.3" dependencies: + - "lowest" - "highest" steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Setup PHP, with composer and extensions" uses: "shivammathur/setup-php@v2" @@ -112,7 +112,7 @@ jobs: coverage: "none" - name: "Install composer dependencies" - uses: "ramsey/composer-install@v2" + uses: "ramsey/composer-install@v3" with: dependency-versions: "${{ matrix.dependencies }}" @@ -127,10 +127,9 @@ jobs: strategy: matrix: php-version: - - "7.4" - - "8.0" - "8.1" - "8.2" + - "8.3" dependencies: - "lowest" @@ -138,7 +137,7 @@ jobs: steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Setup PHP, with composer and extensions" uses: "shivammathur/setup-php@v2" @@ -148,12 +147,12 @@ jobs: coverage: "none" - name: "Install composer dependencies" - uses: "ramsey/composer-install@v2" + uses: "ramsey/composer-install@v3" with: dependency-versions: "${{ matrix.dependencies }}" - name: "Run phpunit" - run: "vendor/bin/phpunit --no-coverage" + run: "vendor/bin/phpunit" code-coverage: name: "Code Coverage" @@ -163,14 +162,14 @@ jobs: strategy: matrix: php-version: - - "8.2" + - "8.3" dependencies: - "highest" steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Setup PHP, with composer and extensions" uses: "shivammathur/setup-php@v2" @@ -179,11 +178,8 @@ jobs: extensions: "${{ env.PHP_EXTENSIONS }}" php-version: "${{ matrix.php-version }}" - - name: "Set up problem matchers for phpunit/phpunit" - run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\"" - - name: "Install composer dependencies" - uses: "ramsey/composer-install@v2" + uses: "ramsey/composer-install@v3" with: dependency-versions: "${{ matrix.dependencies }}" @@ -191,9 +187,9 @@ jobs: run: "vendor/bin/phpunit --coverage-clover=.build/logs/clover.xml" - name: "Send code coverage report to Codecov.io" - env: - CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" - run: "bash <(curl -s https://codecov.io/bash)" + uses: "codecov/codecov-action@v4" + with: + token: "${{ secrets.CODECOV_TOKEN }}" mutation-tests: name: "Mutation tests" @@ -203,14 +199,14 @@ jobs: strategy: matrix: php-version: - - "8.2" + - "8.3" dependencies: - "highest" steps: - name: "Checkout" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" - name: "Setup PHP, with composer and extensions" uses: "shivammathur/setup-php@v2" @@ -220,7 +216,7 @@ jobs: php-version: "${{ matrix.php-version }}" - name: "Install composer dependencies" - uses: "ramsey/composer-install@v2" + uses: "ramsey/composer-install@v3" with: dependency-versions: "${{ matrix.dependencies }}" diff --git a/LICENSE b/LICENSE index dc9924d..ddee45d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Setono +Copyright (c) 2024 Setono Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/composer.json b/composer.json index e05001c..5115b81 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": ">=7.4", + "php": ">=8.1", "ext-hash": "*", "psr/event-dispatcher": "^1.0", "psr/log": "^1.1 || ^2.0 || ^3.0", @@ -20,7 +20,7 @@ "infection/infection": "^0.26", "phpunit/phpunit": "^9.6", "psalm/plugin-phpunit": "^0.18", - "setono/code-quality-pack": "^2.4" + "setono/code-quality-pack": "^2.7" }, "prefer-stable": true, "autoload": { diff --git a/ecs.php b/ecs.php index 716ed1f..d463917 100644 --- a/ecs.php +++ b/ecs.php @@ -2,12 +2,11 @@ declare(strict_types=1); -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -use Symplify\EasyCodingStandard\ValueObject\Option; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $config): void { +return static function (ECSConfig $config): void { $config->import('vendor/sylius-labs/coding-standard/ecs.php'); - $config->parameters()->set(Option::PATHS, [ + $config->paths([ 'src', 'tests' ]); };