From 90ffcb0874db17ea0874522c4c77db733e8c4600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 27 Jun 2023 09:48:03 +0200 Subject: [PATCH] Fix: Drop support for PHP 8.0 --- .github/settings.yml | 17 +++++++--------- .github/workflows/integrate.yaml | 15 +++++++------- .github/workflows/renew.yaml | 2 +- .php-cs-fixer.php | 2 +- CHANGELOG.md | 5 +++++ composer.json | 4 ++-- composer.lock | 6 +++--- infection.json | 2 +- psalm-baseline.xml | 34 +------------------------------- rector.php | 2 +- src/Constructs.php | 11 +---------- 11 files changed, 30 insertions(+), 70 deletions(-) diff --git a/.github/settings.yml b/.github/settings.yml index 58f1b0e2..0ef38357 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -14,16 +14,13 @@ branches: required_approving_review_count: 1 required_status_checks: checks: - - context: "Code Coverage (8.0, locked)" - - context: "Coding Standards (8.0, locked)" - - context: "Dependency Analysis (8.0, locked)" - - context: "Mutation Tests (8.0, locked)" - - context: "Refactoring (8.0, locked)" - - context: "Security Analysis (8.0, locked)" - - context: "Static Code Analysis (8.0, locked)" - - context: "Tests (8.0, highest)" - - context: "Tests (8.0, locked)" - - context: "Tests (8.0, lowest)" + - context: "Code Coverage (8.1, locked)" + - context: "Coding Standards (8.1, locked)" + - context: "Dependency Analysis (8.1, locked)" + - context: "Mutation Tests (8.1, locked)" + - context: "Refactoring (8.1, locked)" + - context: "Security Analysis (8.1, locked)" + - context: "Static Code Analysis (8.1, locked)" - context: "Tests (8.1, highest)" - context: "Tests (8.1, locked)" - context: "Tests (8.1, lowest)" diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 96ce85e6..dc8446d8 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -17,7 +17,7 @@ jobs: strategy: matrix: php-version: - - "8.0" + - "8.1" dependencies: - "locked" @@ -76,7 +76,7 @@ jobs: strategy: matrix: php-version: - - "8.0" + - "8.1" dependencies: - "locked" @@ -146,7 +146,7 @@ jobs: strategy: matrix: php-version: - - "8.0" + - "8.1" dependencies: - "locked" @@ -200,7 +200,7 @@ jobs: strategy: matrix: php-version: - - "8.0" + - "8.1" dependencies: - "locked" @@ -250,7 +250,7 @@ jobs: strategy: matrix: php-version: - - "8.0" + - "8.1" dependencies: - "locked" @@ -310,7 +310,7 @@ jobs: strategy: matrix: php-version: - - "8.0" + - "8.1" dependencies: - "locked" @@ -358,7 +358,7 @@ jobs: strategy: matrix: php-version: - - "8.0" + - "8.1" dependencies: - "locked" @@ -409,7 +409,6 @@ jobs: strategy: matrix: php-version: - - "8.0" - "8.1" - "8.2" diff --git a/.github/workflows/renew.yaml b/.github/workflows/renew.yaml index da34c8a1..b4f06703 100644 --- a/.github/workflows/renew.yaml +++ b/.github/workflows/renew.yaml @@ -15,7 +15,7 @@ jobs: strategy: matrix: php-version: - - "8.0" + - "8.1" dependencies: - "locked" diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 1d411a26..83e4afe6 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -26,7 +26,7 @@ $license->save(); -$config = PhpCsFixer\Config\Factory::fromRuleSet(new PhpCsFixer\Config\RuleSet\Php80($license->header())); +$config = PhpCsFixer\Config\Factory::fromRuleSet(new PhpCsFixer\Config\RuleSet\Php81($license->header())); $config->getFinder() ->exclude([ diff --git a/CHANGELOG.md b/CHANGELOG.md index 61d2787d..e0eaa779 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), For a full diff see [`1.4.0...main`][1.4.0...main]. +### Changed + +- Dropped support for PHP 8.0 ([#702]), by [@localheinz] + ## [`1.4.0`][1.4.0] For a full diff see [`1.3.0...1.4.0`][1.3.0...1.4.0]. @@ -158,6 +162,7 @@ For a full diff see [`0.4.0...0.5.0`][0.4.0...0.5.0]. [#481]: https://github.com/ergebnis/classy/pull/481 [#486]: https://github.com/ergebnis/classy/pull/486 [#619]: https://github.com/ergebnis/classy/pull/619 +[#702]: https://github.com/ergebnis/classy/pull/702 [@ergebnis]: https://github.com/ergebnis [@localheinz]: https://github.com/localheinz diff --git a/composer.json b/composer.json index d940ded9..0c8cb8b9 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "source": "https://github.com/ergebnis/classy" }, "require": { - "php": "~8.0.0 || ~8.1.0 || ~8.2.0", + "php": "~8.1.0 || ~8.2.0", "ext-tokenizer": "*" }, "require-dev": { @@ -57,7 +57,7 @@ "infection/extension-installer": true }, "platform": { - "php": "8.0.25" + "php": "8.1.20" }, "preferred-install": "dist", "sort-packages": true diff --git a/composer.lock b/composer.lock index e1899240..68dcd2f5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0eb0a905ffdd5a25ca9014f48dd51bb3", + "content-hash": "99b68b5ede77013b1501799511435042", "packages": [], "packages-dev": [ { @@ -6316,12 +6316,12 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "~8.0.0 || ~8.1.0 || ~8.2.0", + "php": "~8.1.0 || ~8.2.0", "ext-tokenizer": "*" }, "platform-dev": [], "platform-overrides": { - "php": "8.0.25" + "php": "8.1.20" }, "plugin-api-version": "2.3.0" } diff --git a/infection.json b/infection.json index de16ff03..4671d7ce 100644 --- a/infection.json +++ b/infection.json @@ -4,7 +4,7 @@ "text": ".build/infection/infection-log.txt" }, "minCoveredMsi": 87, - "minMsi": 82, + "minMsi": 87, "phpUnit": { "configDir": "test\/Unit" }, diff --git a/psalm-baseline.xml b/psalm-baseline.xml index e7410b6d..6b2418f5 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + $fileInfo @@ -25,38 +25,6 @@ }]]> - - - Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Bar\Bar::class - Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Bar\Baz::class - Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Bar\Foo::class - Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Bar\Qux::class - Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Foo\Bar::class - Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Foo\Baz::class - Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Foo\Foo::class - Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Foo\Qux::class - Test\Fixture\Classy\Php81\WithinNamespaceWithBraces\Bar::class - Test\Fixture\Classy\Php81\WithinNamespaceWithBraces\Baz::class - Test\Fixture\Classy\Php81\WithinNamespaceWithBraces\Foo::class - Test\Fixture\Classy\Php81\WithinNamespaceWithBraces\Qux::class - Test\Fixture\Classy\Php81\WithinNamespace\Qux::class - - - Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Bar\Bar - Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Bar\Baz - Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Bar\Foo - Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Bar\Qux - Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Foo\Bar - Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Foo\Baz - Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Foo\Foo - Test\Fixture\Classy\Php81\WithinMultipleNamespaces\Foo\Qux - Test\Fixture\Classy\Php81\WithinNamespaceWithBraces\Bar - Test\Fixture\Classy\Php81\WithinNamespaceWithBraces\Baz - Test\Fixture\Classy\Php81\WithinNamespaceWithBraces\Foo - Test\Fixture\Classy\Php81\WithinNamespaceWithBraces\Qux - Test\Fixture\Classy\Php81\WithinNamespace\Qux - - toInt diff --git a/rector.php b/rector.php index ea309ca0..f2df1b04 100644 --- a/rector.php +++ b/rector.php @@ -25,7 +25,7 @@ __DIR__ . '/test/', ]); - $rectorConfig->phpVersion(Core\ValueObject\PhpVersion::PHP_80); + $rectorConfig->phpVersion(Core\ValueObject\PhpVersion::PHP_81); $rectorConfig->sets([ PHPUnit\Set\PHPUnitSetList::PHPUNIT_91, diff --git a/src/Constructs.php b/src/Constructs.php index ba844ac2..1a3e3241 100644 --- a/src/Constructs.php +++ b/src/Constructs.php @@ -45,20 +45,11 @@ public static function fromSource(string $source): array $classyTokens = [ \T_CLASS, + \T_ENUM, \T_INTERFACE, \T_TRAIT, ]; - // https://wiki.php.net/rfc/enumerations - if (\PHP_VERSION_ID >= 80100 && \defined('T_ENUM')) { - $classyTokens = [ - \T_CLASS, - \T_ENUM, - \T_INTERFACE, - \T_TRAIT, - ]; - } - for ($index = 0; $index < $count; ++$index) { $token = $sequence[$index];