Skip to content

Commit

Permalink
Fix: Remove name() method from AbstractRuleSet
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Sep 15, 2023
1 parent 48167fb commit 7732456
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 23 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions infection.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"logs": {
"text": ".build/infection/infection-log.txt"
},
"minCoveredMsi": 94,
"minMsi": 89,
"minCoveredMsi": 100,
"minMsi": 100,
"phpUnit": {
"configDir": "test\/Unit"
},
Expand Down
21 changes: 0 additions & 21 deletions src/RuleSet/AbstractRuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/RuleSet/Php53.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/RuleSet/Php54.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/RuleSet/Php55.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/RuleSet/Php56.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/RuleSet/Php70.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/RuleSet/Php71.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/RuleSet/Php72.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/RuleSet/Php73.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/RuleSet/Php74.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/RuleSet/Php80.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/RuleSet/Php81.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/RuleSet/Php82.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7732456

Please sign in to comment.