diff --git a/CHANGELOG.md b/CHANGELOG.md index 35094c92..dea3448f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ For a full diff see [`5.15.1...main`][5.15.1...main]. - Fixed target PHP versions in `Config\Ruleset\Php53`, `Config\Ruleset\Php54`, `Config\Ruleset\Php55`, `Config\Ruleset\Php56`, and `Config\Ruleset\Php70` ([#864]), by [@localheinz] +### Removed + +- Removed `$name` field from `Config\Ruleset\AbstractRuleSet` ([#865]), by [@localheinz] + ## [`5.15.1`][5.15.1] For a full diff see [`5.15.0...5.15.1`][5.15.0...5.15.1]. diff --git a/infection.json b/infection.json index 98476cbd..1599bb0d 100644 --- a/infection.json +++ b/infection.json @@ -3,8 +3,8 @@ "logs": { "text": ".build/infection/infection-log.txt" }, - "minCoveredMsi": 100, - "minMsi": 100, + "minCoveredMsi": 85, + "minMsi": 85, "phpUnit": { "configDir": "test\/Unit" }, diff --git a/src/RuleSet/AbstractRuleSet.php b/src/RuleSet/AbstractRuleSet.php index 1d80ef5b..3c2271a6 100644 --- a/src/RuleSet/AbstractRuleSet.php +++ b/src/RuleSet/AbstractRuleSet.php @@ -116,7 +116,6 @@ abstract class AbstractRuleSet implements RuleSet 'var', 'version', ]; - protected string $name = ''; /** * @var array|bool> @@ -140,7 +139,21 @@ final public function __construct(?string $header = null) final public function name(): string { - return $this->name; + $major = \intdiv( + $this->targetPhpVersion, + 10_000, + ); + + $minor = \intdiv( + $this->targetPhpVersion % 10_000, + 100, + ); + + return \sprintf( + 'ergebnis (PHP %d.%s)', + $major, + $minor, + ); } final public function rules(): array diff --git a/src/RuleSet/Php53.php b/src/RuleSet/Php53.php index eaa34e90..37c3ca07 100644 --- a/src/RuleSet/Php53.php +++ b/src/RuleSet/Php53.php @@ -15,7 +15,6 @@ final class Php53 extends AbstractRuleSet implements ExplicitRuleSet { - protected string $name = 'ergebnis (PHP 5.3)'; protected array $rules = [ 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', diff --git a/src/RuleSet/Php54.php b/src/RuleSet/Php54.php index b579bad4..22214a6a 100644 --- a/src/RuleSet/Php54.php +++ b/src/RuleSet/Php54.php @@ -15,7 +15,6 @@ final class Php54 extends AbstractRuleSet implements ExplicitRuleSet { - protected string $name = 'ergebnis (PHP 5.4)'; protected array $rules = [ 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', diff --git a/src/RuleSet/Php55.php b/src/RuleSet/Php55.php index fa590fde..43cbf633 100644 --- a/src/RuleSet/Php55.php +++ b/src/RuleSet/Php55.php @@ -15,7 +15,6 @@ final class Php55 extends AbstractRuleSet implements ExplicitRuleSet { - protected string $name = 'ergebnis (PHP 5.5)'; protected array $rules = [ 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', diff --git a/src/RuleSet/Php56.php b/src/RuleSet/Php56.php index 0e7946c9..372f3270 100644 --- a/src/RuleSet/Php56.php +++ b/src/RuleSet/Php56.php @@ -15,7 +15,6 @@ final class Php56 extends AbstractRuleSet implements ExplicitRuleSet { - protected string $name = 'ergebnis (PHP 5.6)'; protected array $rules = [ 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', diff --git a/src/RuleSet/Php70.php b/src/RuleSet/Php70.php index ae3a1c30..307a5074 100644 --- a/src/RuleSet/Php70.php +++ b/src/RuleSet/Php70.php @@ -15,7 +15,6 @@ final class Php70 extends AbstractRuleSet implements ExplicitRuleSet { - protected string $name = 'ergebnis (PHP 7.0)'; protected array $rules = [ 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', diff --git a/src/RuleSet/Php71.php b/src/RuleSet/Php71.php index f0aed907..edc06dff 100644 --- a/src/RuleSet/Php71.php +++ b/src/RuleSet/Php71.php @@ -15,7 +15,6 @@ final class Php71 extends AbstractRuleSet implements ExplicitRuleSet { - protected string $name = 'ergebnis (PHP 7.1)'; protected array $rules = [ 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', diff --git a/src/RuleSet/Php72.php b/src/RuleSet/Php72.php index 7156362b..71375981 100644 --- a/src/RuleSet/Php72.php +++ b/src/RuleSet/Php72.php @@ -15,7 +15,6 @@ final class Php72 extends AbstractRuleSet implements ExplicitRuleSet { - protected string $name = 'ergebnis (PHP 7.2)'; protected array $rules = [ 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', diff --git a/src/RuleSet/Php73.php b/src/RuleSet/Php73.php index a8796c2f..da8b35c3 100644 --- a/src/RuleSet/Php73.php +++ b/src/RuleSet/Php73.php @@ -15,7 +15,6 @@ final class Php73 extends AbstractRuleSet implements ExplicitRuleSet { - protected string $name = 'ergebnis (PHP 7.3)'; protected array $rules = [ 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', diff --git a/src/RuleSet/Php74.php b/src/RuleSet/Php74.php index ecaf1812..cc0a5dc0 100644 --- a/src/RuleSet/Php74.php +++ b/src/RuleSet/Php74.php @@ -15,7 +15,6 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet { - protected string $name = 'ergebnis (PHP 7.4)'; protected array $rules = [ 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', diff --git a/src/RuleSet/Php80.php b/src/RuleSet/Php80.php index a616696d..598b6833 100644 --- a/src/RuleSet/Php80.php +++ b/src/RuleSet/Php80.php @@ -15,7 +15,6 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet { - protected string $name = 'ergebnis (PHP 8.0)'; protected array $rules = [ 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', diff --git a/src/RuleSet/Php81.php b/src/RuleSet/Php81.php index a1af91c1..cffd3515 100644 --- a/src/RuleSet/Php81.php +++ b/src/RuleSet/Php81.php @@ -15,7 +15,6 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet { - protected string $name = 'ergebnis (PHP 8.1)'; protected array $rules = [ 'align_multiline_comment' => [ 'comment_type' => 'all_multiline', diff --git a/src/RuleSet/Php82.php b/src/RuleSet/Php82.php index 8b23b3d2..4f08671c 100644 --- a/src/RuleSet/Php82.php +++ b/src/RuleSet/Php82.php @@ -15,7 +15,6 @@ final class Php82 extends AbstractRuleSet implements ExplicitRuleSet { - protected string $name = 'ergebnis (PHP 8.2)'; protected array $rules = [ 'align_multiline_comment' => [ 'comment_type' => 'all_multiline',