From f14d6deb70432016a71a91c428ae0dacce5fdcb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Fri, 15 Sep 2023 12:51:41 +0200 Subject: [PATCH] Fix: Remove name() method from AbstractRuleSet --- CHANGELOG.md | 2 ++ infection.json | 4 ++-- src/RuleSet/AbstractRuleSet.php | 21 --------------------- src/RuleSet/Php53.php | 5 +++++ src/RuleSet/Php54.php | 5 +++++ src/RuleSet/Php55.php | 5 +++++ src/RuleSet/Php56.php | 5 +++++ src/RuleSet/Php70.php | 5 +++++ src/RuleSet/Php71.php | 5 +++++ src/RuleSet/Php72.php | 5 +++++ src/RuleSet/Php73.php | 5 +++++ src/RuleSet/Php74.php | 5 +++++ src/RuleSet/Php80.php | 5 +++++ src/RuleSet/Php81.php | 5 +++++ src/RuleSet/Php82.php | 5 +++++ 15 files changed, 64 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a24d1a3f..ddf20f29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ For a full diff see [`5.15.1...main`][5.15.1...main]. - Removed `$name` field from `Config\Ruleset\AbstractRuleSet` ([#865]), by [@localheinz] - Removed `$targetPhpVersion` field and `targetPhpVersion()` method from `Config\Ruleset\AbstractRuleSet` ([#866]), by [@localheinz] +- Removed `name()` method from `Config\Ruleset\AbstractRuleSet` ([#867]), by [@localheinz] ## [`5.15.1`][5.15.1] @@ -1154,6 +1155,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0]. [#857]: https://github.com/ergebnis/php-cs-fixer-config/pull/857 [#864]: https://github.com/ergebnis/php-cs-fixer-config/pull/864 [#866]: https://github.com/ergebnis/php-cs-fixer-config/pull/866 +[#867]: https://github.com/ergebnis/php-cs-fixer-config/pull/867 [@dependabot]: https://github.com/apps/dependabot [@linuxjuggler]: https://github.com/linuxjuggler diff --git a/infection.json b/infection.json index 32bb0b5d..2e655348 100644 --- a/infection.json +++ b/infection.json @@ -3,8 +3,8 @@ "logs": { "text": ".build/infection/infection-log.txt" }, - "minCoveredMsi": 94, - "minMsi": 89, + "minCoveredMsi": 100, + "minMsi": 93, "phpUnit": { "configDir": "test\/Unit" }, diff --git a/src/RuleSet/AbstractRuleSet.php b/src/RuleSet/AbstractRuleSet.php index 9e33b285..9caf4ef2 100644 --- a/src/RuleSet/AbstractRuleSet.php +++ b/src/RuleSet/AbstractRuleSet.php @@ -136,27 +136,6 @@ final public function __construct(?string $header = null) ]; } - final public function name(): string - { - $targetPhpVersion = $this->targetPhpVersion(); - - $major = \intdiv( - $targetPhpVersion, - 10_000, - ); - - $minor = \intdiv( - $targetPhpVersion % 10_000, - 100, - ); - - return \sprintf( - 'ergebnis (PHP %d.%s)', - $major, - $minor, - ); - } - final public function rules(): array { return $this->rules; diff --git a/src/RuleSet/Php53.php b/src/RuleSet/Php53.php index 8d69cc95..407f3b45 100644 --- a/src/RuleSet/Php53.php +++ b/src/RuleSet/Php53.php @@ -810,6 +810,11 @@ final class Php53 extends AbstractRuleSet implements ExplicitRuleSet ], ]; + public function name(): string + { + return 'ergebnis (PHP 5.3)'; + } + public function targetPhpVersion(): int { return 50300; diff --git a/src/RuleSet/Php54.php b/src/RuleSet/Php54.php index fc9997e7..fbd59ee7 100644 --- a/src/RuleSet/Php54.php +++ b/src/RuleSet/Php54.php @@ -812,6 +812,11 @@ final class Php54 extends AbstractRuleSet implements ExplicitRuleSet ], ]; + public function name(): string + { + return 'ergebnis (PHP 5.4)'; + } + public function targetPhpVersion(): int { return 50400; diff --git a/src/RuleSet/Php55.php b/src/RuleSet/Php55.php index 9330bf25..76ffb6d9 100644 --- a/src/RuleSet/Php55.php +++ b/src/RuleSet/Php55.php @@ -821,6 +821,11 @@ final class Php55 extends AbstractRuleSet implements ExplicitRuleSet ], ]; + public function name(): string + { + return 'ergebnis (PHP 5.5)'; + } + public function targetPhpVersion(): int { return 50500; diff --git a/src/RuleSet/Php56.php b/src/RuleSet/Php56.php index 0ce87400..87a047a8 100644 --- a/src/RuleSet/Php56.php +++ b/src/RuleSet/Php56.php @@ -821,6 +821,11 @@ final class Php56 extends AbstractRuleSet implements ExplicitRuleSet ], ]; + public function name(): string + { + return 'ergebnis (PHP 5.6)'; + } + public function targetPhpVersion(): int { return 50600; diff --git a/src/RuleSet/Php70.php b/src/RuleSet/Php70.php index 24584869..0e250be0 100644 --- a/src/RuleSet/Php70.php +++ b/src/RuleSet/Php70.php @@ -821,6 +821,11 @@ final class Php70 extends AbstractRuleSet implements ExplicitRuleSet ], ]; + public function name(): string + { + return 'ergebnis (PHP 7.0)'; + } + public function targetPhpVersion(): int { return 70000; diff --git a/src/RuleSet/Php71.php b/src/RuleSet/Php71.php index ead5afec..f8b1dc48 100644 --- a/src/RuleSet/Php71.php +++ b/src/RuleSet/Php71.php @@ -824,6 +824,11 @@ final class Php71 extends AbstractRuleSet implements ExplicitRuleSet ], ]; + public function name(): string + { + return 'ergebnis (PHP 7.1)'; + } + public function targetPhpVersion(): int { return 70100; diff --git a/src/RuleSet/Php72.php b/src/RuleSet/Php72.php index 46968556..b28abe10 100644 --- a/src/RuleSet/Php72.php +++ b/src/RuleSet/Php72.php @@ -824,6 +824,11 @@ final class Php72 extends AbstractRuleSet implements ExplicitRuleSet ], ]; + public function name(): string + { + return 'ergebnis (PHP 7.2)'; + } + public function targetPhpVersion(): int { return 70200; diff --git a/src/RuleSet/Php73.php b/src/RuleSet/Php73.php index d8c808fd..a41d8988 100644 --- a/src/RuleSet/Php73.php +++ b/src/RuleSet/Php73.php @@ -825,6 +825,11 @@ final class Php73 extends AbstractRuleSet implements ExplicitRuleSet ], ]; + public function name(): string + { + return 'ergebnis (PHP 7.3)'; + } + public function targetPhpVersion(): int { return 70300; diff --git a/src/RuleSet/Php74.php b/src/RuleSet/Php74.php index 05f84de1..520d1bdd 100644 --- a/src/RuleSet/Php74.php +++ b/src/RuleSet/Php74.php @@ -828,6 +828,11 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet ], ]; + public function name(): string + { + return 'ergebnis (PHP 7.4)'; + } + public function targetPhpVersion(): int { return 70400; diff --git a/src/RuleSet/Php80.php b/src/RuleSet/Php80.php index 0f7bd5ca..8ece330f 100644 --- a/src/RuleSet/Php80.php +++ b/src/RuleSet/Php80.php @@ -837,6 +837,11 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet ], ]; + public function name(): string + { + return 'ergebnis (PHP 8.0)'; + } + public function targetPhpVersion(): int { return 80000; diff --git a/src/RuleSet/Php81.php b/src/RuleSet/Php81.php index 83cdcafc..46a6ca9f 100644 --- a/src/RuleSet/Php81.php +++ b/src/RuleSet/Php81.php @@ -839,6 +839,11 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet ], ]; + public function name(): string + { + return 'ergebnis (PHP 8.1)'; + } + public function targetPhpVersion(): int { return 80100; diff --git a/src/RuleSet/Php82.php b/src/RuleSet/Php82.php index f8f02816..0a79918d 100644 --- a/src/RuleSet/Php82.php +++ b/src/RuleSet/Php82.php @@ -839,6 +839,11 @@ final class Php82 extends AbstractRuleSet implements ExplicitRuleSet ], ]; + public function name(): string + { + return 'ergebnis (PHP 8.2)'; + } + public function targetPhpVersion(): int { return 80200;