Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Remove constructor from RuleSet\AbstractRuleSet #876

Merged
merged 1 commit into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ For a full diff see [`5.15.1...main`][5.15.1...main].
- Removed `name()` method from `Config\Ruleset\AbstractRuleSet` ([#867]), by [@localheinz]
- Removed `rules()` method from `Config\Ruleset\AbstractRuleSet` ([#868]), by [@localheinz]
- Removed `DOCTRINE_IGNORED_TAGS` constant from `Config\Ruleset\AbstractRuleSet` ([#875]), by [@localheinz]
- Removed constructor from `Config\Ruleset\AbstractRuleSet` ([#876]), by [@localheinz]

## [`5.15.1`][5.15.1]

Expand Down Expand Up @@ -1174,6 +1175,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0].
[#872]: https://github.com/ergebnis/php-cs-fixer-config/pull/872
[#874]: https://github.com/ergebnis/php-cs-fixer-config/pull/874
[#875]: https://github.com/ergebnis/php-cs-fixer-config/pull/875
[#876]: https://github.com/ergebnis/php-cs-fixer-config/pull/876

[@dependabot]: https://github.com/apps/dependabot
[@linuxjuggler]: https://github.com/linuxjuggler
Expand Down
42 changes: 39 additions & 3 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.15.0@5c774aca4746caf3d239d9c8cadb9f882ca29352">
<file src="src/RuleSet/AbstractRuleSet.php">
<PossiblyUnusedMethod>
<code>__construct</code>
</PossiblyUnusedMethod>
<PossiblyUnusedProperty>
<code>$rules</code>
</PossiblyUnusedProperty>
</file>
<file src="src/RuleSet/Php53.php">
<MixedArgumentTypeCoercion>
Expand All @@ -12,6 +12,9 @@
<NonInvariantDocblockPropertyType>
<code>$rules</code>
</NonInvariantDocblockPropertyType>
<PossiblyUnusedMethod>
<code>__construct</code>
</PossiblyUnusedMethod>
</file>
<file src="src/RuleSet/Php54.php">
<MixedArgumentTypeCoercion>
Expand All @@ -20,6 +23,9 @@
<NonInvariantDocblockPropertyType>
<code>$rules</code>
</NonInvariantDocblockPropertyType>
<PossiblyUnusedMethod>
<code>__construct</code>
</PossiblyUnusedMethod>
</file>
<file src="src/RuleSet/Php55.php">
<MixedArgumentTypeCoercion>
Expand All @@ -28,6 +34,9 @@
<NonInvariantDocblockPropertyType>
<code>$rules</code>
</NonInvariantDocblockPropertyType>
<PossiblyUnusedMethod>
<code>__construct</code>
</PossiblyUnusedMethod>
</file>
<file src="src/RuleSet/Php56.php">
<MixedArgumentTypeCoercion>
Expand All @@ -36,6 +45,9 @@
<NonInvariantDocblockPropertyType>
<code>$rules</code>
</NonInvariantDocblockPropertyType>
<PossiblyUnusedMethod>
<code>__construct</code>
</PossiblyUnusedMethod>
</file>
<file src="src/RuleSet/Php70.php">
<MixedArgumentTypeCoercion>
Expand All @@ -44,6 +56,9 @@
<NonInvariantDocblockPropertyType>
<code>$rules</code>
</NonInvariantDocblockPropertyType>
<PossiblyUnusedMethod>
<code>__construct</code>
</PossiblyUnusedMethod>
</file>
<file src="src/RuleSet/Php71.php">
<MixedArgumentTypeCoercion>
Expand All @@ -52,6 +67,9 @@
<NonInvariantDocblockPropertyType>
<code>$rules</code>
</NonInvariantDocblockPropertyType>
<PossiblyUnusedMethod>
<code>__construct</code>
</PossiblyUnusedMethod>
</file>
<file src="src/RuleSet/Php72.php">
<MixedArgumentTypeCoercion>
Expand All @@ -60,6 +78,9 @@
<NonInvariantDocblockPropertyType>
<code>$rules</code>
</NonInvariantDocblockPropertyType>
<PossiblyUnusedMethod>
<code>__construct</code>
</PossiblyUnusedMethod>
</file>
<file src="src/RuleSet/Php73.php">
<MixedArgumentTypeCoercion>
Expand All @@ -68,6 +89,9 @@
<NonInvariantDocblockPropertyType>
<code>$rules</code>
</NonInvariantDocblockPropertyType>
<PossiblyUnusedMethod>
<code>__construct</code>
</PossiblyUnusedMethod>
</file>
<file src="src/RuleSet/Php74.php">
<MixedArgumentTypeCoercion>
Expand All @@ -76,6 +100,9 @@
<NonInvariantDocblockPropertyType>
<code>$rules</code>
</NonInvariantDocblockPropertyType>
<PossiblyUnusedMethod>
<code>__construct</code>
</PossiblyUnusedMethod>
</file>
<file src="src/RuleSet/Php80.php">
<MixedArgumentTypeCoercion>
Expand All @@ -84,6 +111,9 @@
<NonInvariantDocblockPropertyType>
<code>$rules</code>
</NonInvariantDocblockPropertyType>
<PossiblyUnusedMethod>
<code>__construct</code>
</PossiblyUnusedMethod>
</file>
<file src="src/RuleSet/Php81.php">
<MixedArgumentTypeCoercion>
Expand All @@ -92,6 +122,9 @@
<NonInvariantDocblockPropertyType>
<code>$rules</code>
</NonInvariantDocblockPropertyType>
<PossiblyUnusedMethod>
<code>__construct</code>
</PossiblyUnusedMethod>
</file>
<file src="src/RuleSet/Php82.php">
<MixedArgumentTypeCoercion>
Expand All @@ -100,6 +133,9 @@
<NonInvariantDocblockPropertyType>
<code>$rules</code>
</NonInvariantDocblockPropertyType>
<PossiblyUnusedMethod>
<code>__construct</code>
</PossiblyUnusedMethod>
</file>
<file src="src/Rules.php">
<MixedArgumentTypeCoercion>
Expand Down
14 changes: 0 additions & 14 deletions src/RuleSet/AbstractRuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,4 @@ abstract class AbstractRuleSet implements RuleSet
* @var array<string, array<string, mixed>|bool>
*/
protected array $rules = [];

final public function __construct(?string $header = null)
{
if (null === $header) {
return;
}

$this->rules['header_comment'] = [
'comment_type' => 'PHPDoc',
'header' => \trim($header),
'location' => 'after_declare_strict',
'separate' => 'both',
];
}
}
14 changes: 14 additions & 0 deletions src/RuleSet/Php53.php
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,20 @@ final class Php53 extends AbstractRuleSet implements ExplicitRuleSet
],
];

public function __construct(?string $header = null)
{
if (null === $header) {
return;
}

$this->rules['header_comment'] = [
'comment_type' => 'PHPDoc',
'header' => \trim($header),
'location' => 'after_declare_strict',
'separate' => 'both',
];
}

public function customFixers(): iterable
{
yield from [];
Expand Down
14 changes: 14 additions & 0 deletions src/RuleSet/Php54.php
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,20 @@ final class Php54 extends AbstractRuleSet implements ExplicitRuleSet
],
];

public function __construct(?string $header = null)
{
if (null === $header) {
return;
}

$this->rules['header_comment'] = [
'comment_type' => 'PHPDoc',
'header' => \trim($header),
'location' => 'after_declare_strict',
'separate' => 'both',
];
}

public function customFixers(): iterable
{
yield from [];
Expand Down
14 changes: 14 additions & 0 deletions src/RuleSet/Php55.php
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,20 @@ final class Php55 extends AbstractRuleSet implements ExplicitRuleSet
],
];

public function __construct(?string $header = null)
{
if (null === $header) {
return;
}

$this->rules['header_comment'] = [
'comment_type' => 'PHPDoc',
'header' => \trim($header),
'location' => 'after_declare_strict',
'separate' => 'both',
];
}

public function customFixers(): iterable
{
yield from [];
Expand Down
14 changes: 14 additions & 0 deletions src/RuleSet/Php56.php
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,20 @@ final class Php56 extends AbstractRuleSet implements ExplicitRuleSet
],
];

public function __construct(?string $header = null)
{
if (null === $header) {
return;
}

$this->rules['header_comment'] = [
'comment_type' => 'PHPDoc',
'header' => \trim($header),
'location' => 'after_declare_strict',
'separate' => 'both',
];
}

public function customFixers(): iterable
{
yield from [];
Expand Down
14 changes: 14 additions & 0 deletions src/RuleSet/Php70.php
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,20 @@ final class Php70 extends AbstractRuleSet implements ExplicitRuleSet
],
];

public function __construct(?string $header = null)
{
if (null === $header) {
return;
}

$this->rules['header_comment'] = [
'comment_type' => 'PHPDoc',
'header' => \trim($header),
'location' => 'after_declare_strict',
'separate' => 'both',
];
}

public function customFixers(): iterable
{
yield from [];
Expand Down
14 changes: 14 additions & 0 deletions src/RuleSet/Php71.php
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,20 @@ final class Php71 extends AbstractRuleSet implements ExplicitRuleSet
],
];

public function __construct(?string $header = null)
{
if (null === $header) {
return;
}

$this->rules['header_comment'] = [
'comment_type' => 'PHPDoc',
'header' => \trim($header),
'location' => 'after_declare_strict',
'separate' => 'both',
];
}

public function customFixers(): iterable
{
yield from [];
Expand Down
14 changes: 14 additions & 0 deletions src/RuleSet/Php72.php
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,20 @@ final class Php72 extends AbstractRuleSet implements ExplicitRuleSet
],
];

public function __construct(?string $header = null)
{
if (null === $header) {
return;
}

$this->rules['header_comment'] = [
'comment_type' => 'PHPDoc',
'header' => \trim($header),
'location' => 'after_declare_strict',
'separate' => 'both',
];
}

public function customFixers(): iterable
{
yield from [];
Expand Down
14 changes: 14 additions & 0 deletions src/RuleSet/Php73.php
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,20 @@ final class Php73 extends AbstractRuleSet implements ExplicitRuleSet
],
];

public function __construct(?string $header = null)
{
if (null === $header) {
return;
}

$this->rules['header_comment'] = [
'comment_type' => 'PHPDoc',
'header' => \trim($header),
'location' => 'after_declare_strict',
'separate' => 'both',
];
}

public function customFixers(): iterable
{
yield from [];
Expand Down
14 changes: 14 additions & 0 deletions src/RuleSet/Php74.php
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,20 @@ final class Php74 extends AbstractRuleSet implements ExplicitRuleSet
],
];

public function __construct(?string $header = null)
{
if (null === $header) {
return;
}

$this->rules['header_comment'] = [
'comment_type' => 'PHPDoc',
'header' => \trim($header),
'location' => 'after_declare_strict',
'separate' => 'both',
];
}

public function customFixers(): iterable
{
yield from [];
Expand Down
14 changes: 14 additions & 0 deletions src/RuleSet/Php80.php
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,20 @@ final class Php80 extends AbstractRuleSet implements ExplicitRuleSet
],
];

public function __construct(?string $header = null)
{
if (null === $header) {
return;
}

$this->rules['header_comment'] = [
'comment_type' => 'PHPDoc',
'header' => \trim($header),
'location' => 'after_declare_strict',
'separate' => 'both',
];
}

public function customFixers(): iterable
{
yield from [];
Expand Down
14 changes: 14 additions & 0 deletions src/RuleSet/Php81.php
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,20 @@ final class Php81 extends AbstractRuleSet implements ExplicitRuleSet
],
];

public function __construct(?string $header = null)
{
if (null === $header) {
return;
}

$this->rules['header_comment'] = [
'comment_type' => 'PHPDoc',
'header' => \trim($header),
'location' => 'after_declare_strict',
'separate' => 'both',
];
}

public function customFixers(): iterable
{
yield from [];
Expand Down
Loading