Skip to content

Commit 493f8f0

Browse files
authored
Merge pull request #1200 from ergebnis/feature/php-unit-requires-constraint
Enhancement: Enable `PhpCsFixerCustomFixers/php_unit_requires_constraint` fixer
2 parents 3e2be03 + 88bc9fa commit 493f8f0

29 files changed

+58
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ For a full diff see [`6.45.0...main`][6.45.0...main].
1111
### Changed
1212

1313
- Updated `kubawerlos/php-cs-fixer-custom-fixers` ([#1193]), by [@dependabot]
14+
- Enabled the `PhpCsFixerCustomFixers/php_unit_requires_constraint` fixer ([#1200]), by [@localheinz]
1415

1516
## [`6.45.0`][6.45.0]
1617

@@ -1919,6 +1920,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0].
19191920
[#1183]: https://github.com/ergebnis/php-cs-fixer-config/pull/1183
19201921
[#1187]: https://github.com/ergebnis/php-cs-fixer-config/pull/1187
19211922
[#1193]: https://github.com/ergebnis/php-cs-fixer-config/pull/1193
1923+
[#1200]: https://github.com/ergebnis/php-cs-fixer-config/pull/1200
19221924

19231925
[@dependabot]: https://github.com/apps/dependabot
19241926
[@linuxjuggler]: https://github.com/linuxjuggler

src/RuleSet/Php53.php

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public static function create(): RuleSet
3737
new Fixer\NoDuplicatedArrayKeyFixer(),
3838
new Fixer\NoDuplicatedImportsFixer(),
3939
new Fixer\PhpdocTypesCommaSpacesFixer(),
40+
new Fixer\PhpUnitRequiresConstraintFixer(),
4041
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
4142
),
4243
Name::fromString(\sprintf(
@@ -52,6 +53,7 @@ public static function create(): RuleSet
5253
'ignore_expressions' => true,
5354
],
5455
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
56+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
5557
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
5658
'align_multiline_comment' => [
5759
'comment_type' => 'all_multiline',

src/RuleSet/Php54.php

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public static function create(): RuleSet
3737
new Fixer\NoDuplicatedArrayKeyFixer(),
3838
new Fixer\NoDuplicatedImportsFixer(),
3939
new Fixer\PhpdocTypesCommaSpacesFixer(),
40+
new Fixer\PhpUnitRequiresConstraintFixer(),
4041
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
4142
),
4243
Name::fromString(\sprintf(
@@ -52,6 +53,7 @@ public static function create(): RuleSet
5253
'ignore_expressions' => true,
5354
],
5455
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
56+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
5557
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
5658
'align_multiline_comment' => [
5759
'comment_type' => 'all_multiline',

src/RuleSet/Php55.php

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public static function create(): RuleSet
3737
new Fixer\NoDuplicatedArrayKeyFixer(),
3838
new Fixer\NoDuplicatedImportsFixer(),
3939
new Fixer\PhpdocTypesCommaSpacesFixer(),
40+
new Fixer\PhpUnitRequiresConstraintFixer(),
4041
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
4142
),
4243
Name::fromString(\sprintf(
@@ -52,6 +53,7 @@ public static function create(): RuleSet
5253
'ignore_expressions' => true,
5354
],
5455
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
56+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
5557
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
5658
'align_multiline_comment' => [
5759
'comment_type' => 'all_multiline',

src/RuleSet/Php56.php

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public static function create(): RuleSet
3737
new Fixer\NoDuplicatedArrayKeyFixer(),
3838
new Fixer\NoDuplicatedImportsFixer(),
3939
new Fixer\PhpdocTypesCommaSpacesFixer(),
40+
new Fixer\PhpUnitRequiresConstraintFixer(),
4041
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
4142
),
4243
Name::fromString(\sprintf(
@@ -52,6 +53,7 @@ public static function create(): RuleSet
5253
'ignore_expressions' => true,
5354
],
5455
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
56+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
5557
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
5658
'align_multiline_comment' => [
5759
'comment_type' => 'all_multiline',

src/RuleSet/Php70.php

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public static function create(): RuleSet
3737
new Fixer\NoDuplicatedArrayKeyFixer(),
3838
new Fixer\NoDuplicatedImportsFixer(),
3939
new Fixer\PhpdocTypesCommaSpacesFixer(),
40+
new Fixer\PhpUnitRequiresConstraintFixer(),
4041
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
4142
),
4243
Name::fromString(\sprintf(
@@ -52,6 +53,7 @@ public static function create(): RuleSet
5253
'ignore_expressions' => true,
5354
],
5455
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
56+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
5557
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
5658
'align_multiline_comment' => [
5759
'comment_type' => 'all_multiline',

src/RuleSet/Php71.php

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public static function create(): RuleSet
3737
new Fixer\NoDuplicatedArrayKeyFixer(),
3838
new Fixer\NoDuplicatedImportsFixer(),
3939
new Fixer\PhpdocTypesCommaSpacesFixer(),
40+
new Fixer\PhpUnitRequiresConstraintFixer(),
4041
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
4142
),
4243
Name::fromString(\sprintf(
@@ -52,6 +53,7 @@ public static function create(): RuleSet
5253
'ignore_expressions' => true,
5354
],
5455
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
56+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
5557
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
5658
'align_multiline_comment' => [
5759
'comment_type' => 'all_multiline',

src/RuleSet/Php72.php

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public static function create(): RuleSet
3737
new Fixer\NoDuplicatedArrayKeyFixer(),
3838
new Fixer\NoDuplicatedImportsFixer(),
3939
new Fixer\PhpdocTypesCommaSpacesFixer(),
40+
new Fixer\PhpUnitRequiresConstraintFixer(),
4041
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
4142
),
4243
Name::fromString(\sprintf(
@@ -52,6 +53,7 @@ public static function create(): RuleSet
5253
'ignore_expressions' => true,
5354
],
5455
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
56+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
5557
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
5658
'align_multiline_comment' => [
5759
'comment_type' => 'all_multiline',

src/RuleSet/Php73.php

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public static function create(): RuleSet
3737
new Fixer\NoDuplicatedArrayKeyFixer(),
3838
new Fixer\NoDuplicatedImportsFixer(),
3939
new Fixer\PhpdocTypesCommaSpacesFixer(),
40+
new Fixer\PhpUnitRequiresConstraintFixer(),
4041
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
4142
),
4243
Name::fromString(\sprintf(
@@ -52,6 +53,7 @@ public static function create(): RuleSet
5253
'ignore_expressions' => true,
5354
],
5455
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
56+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
5557
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
5658
'align_multiline_comment' => [
5759
'comment_type' => 'all_multiline',

src/RuleSet/Php74.php

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public static function create(): RuleSet
3737
new Fixer\NoDuplicatedArrayKeyFixer(),
3838
new Fixer\NoDuplicatedImportsFixer(),
3939
new Fixer\PhpdocTypesCommaSpacesFixer(),
40+
new Fixer\PhpUnitRequiresConstraintFixer(),
4041
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
4142
),
4243
Name::fromString(\sprintf(
@@ -52,6 +53,7 @@ public static function create(): RuleSet
5253
'ignore_expressions' => true,
5354
],
5455
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
56+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
5557
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
5658
'align_multiline_comment' => [
5759
'comment_type' => 'all_multiline',

src/RuleSet/Php80.php

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public static function create(): RuleSet
3838
new Fixer\NoDuplicatedArrayKeyFixer(),
3939
new Fixer\NoDuplicatedImportsFixer(),
4040
new Fixer\PhpdocTypesCommaSpacesFixer(),
41+
new Fixer\PhpUnitRequiresConstraintFixer(),
4142
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
4243
),
4344
Name::fromString(\sprintf(
@@ -57,6 +58,7 @@ public static function create(): RuleSet
5758
'ignore_expressions' => true,
5859
],
5960
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
61+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
6062
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
6163
'align_multiline_comment' => [
6264
'comment_type' => 'all_multiline',

src/RuleSet/Php81.php

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public static function create(): RuleSet
3838
new Fixer\NoDuplicatedArrayKeyFixer(),
3939
new Fixer\NoDuplicatedImportsFixer(),
4040
new Fixer\PhpdocTypesCommaSpacesFixer(),
41+
new Fixer\PhpUnitRequiresConstraintFixer(),
4142
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
4243
),
4344
Name::fromString(\sprintf(
@@ -57,6 +58,7 @@ public static function create(): RuleSet
5758
'ignore_expressions' => true,
5859
],
5960
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
61+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
6062
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
6163
'align_multiline_comment' => [
6264
'comment_type' => 'all_multiline',

src/RuleSet/Php82.php

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public static function create(): RuleSet
3838
new Fixer\NoDuplicatedArrayKeyFixer(),
3939
new Fixer\NoDuplicatedImportsFixer(),
4040
new Fixer\PhpdocTypesCommaSpacesFixer(),
41+
new Fixer\PhpUnitRequiresConstraintFixer(),
4142
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
4243
),
4344
Name::fromString(\sprintf(
@@ -57,6 +58,7 @@ public static function create(): RuleSet
5758
'ignore_expressions' => true,
5859
],
5960
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
61+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
6062
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
6163
'align_multiline_comment' => [
6264
'comment_type' => 'all_multiline',

src/RuleSet/Php83.php

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public static function create(): RuleSet
3838
new Fixer\NoDuplicatedArrayKeyFixer(),
3939
new Fixer\NoDuplicatedImportsFixer(),
4040
new Fixer\PhpdocTypesCommaSpacesFixer(),
41+
new Fixer\PhpUnitRequiresConstraintFixer(),
4142
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
4243
),
4344
Name::fromString(\sprintf(
@@ -57,6 +58,7 @@ public static function create(): RuleSet
5758
'ignore_expressions' => true,
5859
],
5960
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
61+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
6062
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
6163
'align_multiline_comment' => [
6264
'comment_type' => 'all_multiline',

src/RuleSet/Php84.php

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public static function create(): RuleSet
3838
new Fixer\NoDuplicatedArrayKeyFixer(),
3939
new Fixer\NoDuplicatedImportsFixer(),
4040
new Fixer\PhpdocTypesCommaSpacesFixer(),
41+
new Fixer\PhpUnitRequiresConstraintFixer(),
4142
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
4243
),
4344
Name::fromString(\sprintf(
@@ -57,6 +58,7 @@ public static function create(): RuleSet
5758
'ignore_expressions' => true,
5859
],
5960
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
61+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
6062
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
6163
'align_multiline_comment' => [
6264
'comment_type' => 'all_multiline',

test/Unit/RuleSet/Php53Test.php

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ protected function expectedCustomFixers(): Fixers
4848
new Fixer\NoDuplicatedArrayKeyFixer(),
4949
new Fixer\NoDuplicatedImportsFixer(),
5050
new Fixer\PhpdocTypesCommaSpacesFixer(),
51+
new Fixer\PhpUnitRequiresConstraintFixer(),
5152
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
5253
);
5354
}
@@ -75,6 +76,7 @@ protected function expectedRules(): Rules
7576
'ignore_expressions' => true,
7677
],
7778
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
79+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
7880
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
7981
'align_multiline_comment' => [
8082
'comment_type' => 'all_multiline',

test/Unit/RuleSet/Php54Test.php

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ protected function expectedCustomFixers(): Fixers
4848
new Fixer\NoDuplicatedArrayKeyFixer(),
4949
new Fixer\NoDuplicatedImportsFixer(),
5050
new Fixer\PhpdocTypesCommaSpacesFixer(),
51+
new Fixer\PhpUnitRequiresConstraintFixer(),
5152
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
5253
);
5354
}
@@ -75,6 +76,7 @@ protected function expectedRules(): Rules
7576
'ignore_expressions' => true,
7677
],
7778
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
79+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
7880
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
7981
'align_multiline_comment' => [
8082
'comment_type' => 'all_multiline',

test/Unit/RuleSet/Php55Test.php

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ protected function expectedCustomFixers(): Fixers
4343
new Fixer\NoDuplicatedArrayKeyFixer(),
4444
new Fixer\NoDuplicatedImportsFixer(),
4545
new Fixer\PhpdocTypesCommaSpacesFixer(),
46+
new Fixer\PhpUnitRequiresConstraintFixer(),
4647
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
4748
);
4849
}
@@ -75,6 +76,7 @@ protected function expectedRules(): Rules
7576
'ignore_expressions' => true,
7677
],
7778
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
79+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
7880
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
7981
'align_multiline_comment' => [
8082
'comment_type' => 'all_multiline',

test/Unit/RuleSet/Php56Test.php

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ protected function expectedCustomFixers(): Fixers
4848
new Fixer\NoDuplicatedArrayKeyFixer(),
4949
new Fixer\NoDuplicatedImportsFixer(),
5050
new Fixer\PhpdocTypesCommaSpacesFixer(),
51+
new Fixer\PhpUnitRequiresConstraintFixer(),
5152
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
5253
);
5354
}
@@ -75,6 +76,7 @@ protected function expectedRules(): Rules
7576
'ignore_expressions' => true,
7677
],
7778
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
79+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
7880
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
7981
'align_multiline_comment' => [
8082
'comment_type' => 'all_multiline',

test/Unit/RuleSet/Php70Test.php

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ protected function expectedCustomFixers(): Fixers
4848
new Fixer\NoDuplicatedArrayKeyFixer(),
4949
new Fixer\NoDuplicatedImportsFixer(),
5050
new Fixer\PhpdocTypesCommaSpacesFixer(),
51+
new Fixer\PhpUnitRequiresConstraintFixer(),
5152
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
5253
);
5354
}
@@ -75,6 +76,7 @@ protected function expectedRules(): Rules
7576
'ignore_expressions' => true,
7677
],
7778
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
79+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
7880
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
7981
'align_multiline_comment' => [
8082
'comment_type' => 'all_multiline',

test/Unit/RuleSet/Php71Test.php

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ protected function expectedCustomFixers(): Fixers
4848
new Fixer\NoDuplicatedArrayKeyFixer(),
4949
new Fixer\NoDuplicatedImportsFixer(),
5050
new Fixer\PhpdocTypesCommaSpacesFixer(),
51+
new Fixer\PhpUnitRequiresConstraintFixer(),
5152
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
5253
);
5354
}
@@ -75,6 +76,7 @@ protected function expectedRules(): Rules
7576
'ignore_expressions' => true,
7677
],
7778
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
79+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
7880
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
7981
'align_multiline_comment' => [
8082
'comment_type' => 'all_multiline',

test/Unit/RuleSet/Php72Test.php

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ protected function expectedCustomFixers(): Fixers
4848
new Fixer\NoDuplicatedArrayKeyFixer(),
4949
new Fixer\NoDuplicatedImportsFixer(),
5050
new Fixer\PhpdocTypesCommaSpacesFixer(),
51+
new Fixer\PhpUnitRequiresConstraintFixer(),
5152
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
5253
);
5354
}
@@ -75,6 +76,7 @@ protected function expectedRules(): Rules
7576
'ignore_expressions' => true,
7677
],
7778
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
79+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
7880
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
7981
'align_multiline_comment' => [
8082
'comment_type' => 'all_multiline',

test/Unit/RuleSet/Php73Test.php

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ protected function expectedCustomFixers(): Fixers
4848
new Fixer\NoDuplicatedArrayKeyFixer(),
4949
new Fixer\NoDuplicatedImportsFixer(),
5050
new Fixer\PhpdocTypesCommaSpacesFixer(),
51+
new Fixer\PhpUnitRequiresConstraintFixer(),
5152
new PhpCsFixer\Fixer\Whitespace\LineBreakAfterStatementsFixer(),
5253
);
5354
}
@@ -75,6 +76,7 @@ protected function expectedRules(): Rules
7576
'ignore_expressions' => true,
7677
],
7778
'PhpCsFixerCustomFixers/no_duplicated_imports' => true,
79+
'PhpCsFixerCustomFixers/php_unit_requires_constraint' => true,
7880
'PhpCsFixerCustomFixers/phpdoc_types_comma_spaces' => true,
7981
'align_multiline_comment' => [
8082
'comment_type' => 'all_multiline',

0 commit comments

Comments
 (0)