From 294804678d5cfe80f3b307f98f6e1fef700dfc9b Mon Sep 17 00:00:00 2001 From: zingimmick Date: Thu, 23 May 2024 22:49:31 +0800 Subject: [PATCH] Re-generate ruleset for PHP Coding Standards Fixer 3.57.2 --- config/set/php-cs-fixer-custom.php | 10 +++---- config/set/php-cs-fixer/per-cs.php | 5 ++++ config/set/php-cs-fixer/per-cs20.php | 5 ++++ config/set/php-cs-fixer/per.php | 5 ++++ config/set/php-cs-fixer/php-cs-fixer.php | 6 +++-- config/set/php-cs-fixer/php84-migration.php | 30 +++++++++++++++++++++ config/set/php-cs-fixer/symfony-risky.php | 1 + config/set/php-cs-fixer/symfony.php | 5 +++- config/set/php84.php | 16 +++++++++++ src/CustomSet.php | 2 -- src/PhpCsFixerRuleSetGenerator.php | 1 + src/PhpVersion.php | 5 ++++ src/Set/ECSSetList.php | 5 ++++ src/Set/PhpCsFixerSetList.php | 5 ++++ 14 files changed, 91 insertions(+), 10 deletions(-) create mode 100644 config/set/php-cs-fixer/php84-migration.php create mode 100644 config/set/php84.php diff --git a/config/set/php-cs-fixer-custom.php b/config/set/php-cs-fixer-custom.php index 71b79c9..d862c54 100644 --- a/config/set/php-cs-fixer-custom.php +++ b/config/set/php-cs-fixer-custom.php @@ -106,6 +106,7 @@ 'phpdoc_tags' => [], ]); $ecsConfig->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocLineSpanFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\StringNotation\ExplicitStringVariableFixer::class); $ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer::class, [ 'allow_mixed' => true, 'remove_inheritdoc' => true, @@ -116,16 +117,16 @@ ]); $ecsConfig->rule(\PhpCsFixer\Fixer\LanguageConstruct\CombineConsecutiveIssetsFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoEmptyReturnFixer::class); - $ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\NullableTypeDeclarationForDefaultNullValueFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\NoSpacesAfterFunctionNameFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\SpacesInsideParenthesesFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\NamespaceNotation\CleanNamespaceFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\NullableTypeDeclarationForDefaultNullValueFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\LanguageConstruct\NullableTypeDeclarationFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Semicolon\SemicolonAfterInstructionFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\LanguageConstruct\FunctionToConstantFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Operator\TernaryToElvisOperatorFixer::class); - $ecsConfig->rule(\PhpCsFixer\Fixer\LanguageConstruct\NullableTypeDeclarationFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer::class); @@ -149,7 +150,6 @@ $ecsConfig->rule(\PhpCsFixer\Fixer\StringNotation\StringLengthToEmptyFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\SimplifiedIfReturnFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\LanguageConstruct\ExplicitIndirectVariableFixer::class); - $ecsConfig->rule(\PhpCsFixer\Fixer\StringNotation\ExplicitStringVariableFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\StringNotation\HeredocToNowdocFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\MethodChainingIndentationFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Comment\MultilineCommentOpeningClosingFixer::class); @@ -169,6 +169,7 @@ $ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\Operator\ConcatSpaceFixer::class, [ 'spacing' => 'one', ]); + $ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\CompactNullableTypeDeclarationFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer::class); @@ -225,10 +226,8 @@ $ecsConfig->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocVarWithoutNameFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Operator\StandardizeNotEqualsFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\SwitchContinueToBreakFixer::class); - $ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\TypeDeclarationSpacesFixer::class); - $ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDataProviderNameFixer::class); $ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\PhpUnit\PhpUnitDataProviderStaticFixer::class, [ 'force' => true, @@ -240,6 +239,7 @@ $ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\StaticLambdaFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\ArrayNotation\YieldFromArrayToYieldsFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\StringNotation\NoTrailingWhitespaceInStringFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Alias\ArrayPushFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Alias\EregToPregFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\LanguageConstruct\ErrorSuppressionFixer::class); diff --git a/config/set/php-cs-fixer/per-cs.php b/config/set/php-cs-fixer/per-cs.php index 6a43f35..84392e8 100644 --- a/config/set/php-cs-fixer/per-cs.php +++ b/config/set/php-cs-fixer/per-cs.php @@ -26,6 +26,7 @@ 'closure_fn_spacing' => 'none', ]); $ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\NoSpacesAfterFunctionNameFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\SpacesInsideParenthesesFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); @@ -38,6 +39,10 @@ $ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\Operator\ConcatSpaceFixer::class, [ 'spacing' => 'one', ]); + $ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class, [ + 'after_heredoc' => true, + 'elements' => ['arguments', 'arrays', 'match', 'parameters'], + ]); $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\CompactNullableTypeDeclarationFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer::class); diff --git a/config/set/php-cs-fixer/per-cs20.php b/config/set/php-cs-fixer/per-cs20.php index 3cecdeb..eaaa23a 100644 --- a/config/set/php-cs-fixer/per-cs20.php +++ b/config/set/php-cs-fixer/per-cs20.php @@ -26,6 +26,7 @@ 'closure_fn_spacing' => 'none', ]); $ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\NoSpacesAfterFunctionNameFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\SpacesInsideParenthesesFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); @@ -57,6 +58,10 @@ $ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\Operator\ConcatSpaceFixer::class, [ 'spacing' => 'one', ]); + $ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class, [ + 'after_heredoc' => true, + 'elements' => ['arguments', 'arrays', 'match', 'parameters'], + ]); $ecsConfig->rule(\PhpCsFixer\Fixer\Basic\NoMultipleStatementsPerLineFixer::class); $ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\Basic\BracesPositionFixer::class, [ 'allow_single_line_empty_anonymous_classes' => true, diff --git a/config/set/php-cs-fixer/per.php b/config/set/php-cs-fixer/per.php index 6a43f35..84392e8 100644 --- a/config/set/php-cs-fixer/per.php +++ b/config/set/php-cs-fixer/per.php @@ -26,6 +26,7 @@ 'closure_fn_spacing' => 'none', ]); $ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\NoSpacesAfterFunctionNameFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\SpacesInsideParenthesesFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); @@ -38,6 +39,10 @@ $ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\Operator\ConcatSpaceFixer::class, [ 'spacing' => 'one', ]); + $ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class, [ + 'after_heredoc' => true, + 'elements' => ['arguments', 'arrays', 'match', 'parameters'], + ]); $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\CompactNullableTypeDeclarationFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer::class); diff --git a/config/set/php-cs-fixer/php-cs-fixer.php b/config/set/php-cs-fixer/php-cs-fixer.php index d823b84..ac10192 100644 --- a/config/set/php-cs-fixer/php-cs-fixer.php +++ b/config/set/php-cs-fixer/php-cs-fixer.php @@ -88,6 +88,7 @@ 'remove_inheritdoc' => true, ]); $ecsConfig->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\StringNotation\ExplicitStringVariableFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Operator\NoUselessConcatOperatorFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\LanguageConstruct\CombineConsecutiveIssetsFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoEmptyReturnFixer::class); @@ -95,7 +96,9 @@ $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\SpacesInsideParenthesesFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\NamespaceNotation\CleanNamespaceFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\NullableTypeDeclarationForDefaultNullValueFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\LanguageConstruct\NullableTypeDeclarationFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Semicolon\SemicolonAfterInstructionFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer::class); @@ -106,6 +109,7 @@ $ecsConfig->rule(\PhpCsFixer\Fixer\Import\NoUnneededImportAliasFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Comment\SingleLineCommentSpacingFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Operator\ConcatSpaceFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\CompactNullableTypeDeclarationFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer::class); @@ -167,7 +171,6 @@ $ecsConfig->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocVarWithoutNameFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Operator\StandardizeNotEqualsFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\SwitchContinueToBreakFixer::class); - $ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\TypeDeclarationSpacesFixer::class); $ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer::class, [ @@ -175,7 +178,6 @@ ]); $ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\LanguageConstruct\ExplicitIndirectVariableFixer::class); - $ecsConfig->rule(\PhpCsFixer\Fixer\StringNotation\ExplicitStringVariableFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\StringNotation\HeredocToNowdocFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\MethodChainingIndentationFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Comment\MultilineCommentOpeningClosingFixer::class); diff --git a/config/set/php-cs-fixer/php84-migration.php b/config/set/php-cs-fixer/php84-migration.php new file mode 100644 index 0000000..467c3fe --- /dev/null +++ b/config/set/php-cs-fixer/php84-migration.php @@ -0,0 +1,30 @@ +rule(\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); + $ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class, [ + 'after_heredoc' => true, + ]); + $ecsConfig->rule(\PhpCsFixer\Fixer\NamespaceNotation\CleanNamespaceFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\NullableTypeDeclarationForDefaultNullValueFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\ListNotation\ListSyntaxFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\Basic\OctalNotationFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\CastNotation\NoUnsetCastFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer::class); + $ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer::class, [ + 'after_heredoc' => true, + ]); + $ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class, [ + 'after_heredoc' => true, + ]); + $ecsConfig->rule(\PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\Operator\AssignNullCoalescingToCoalesceEqualFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\StringNotation\SimpleToComplexStringVariableFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\HeredocIndentationFixer::class); +}; diff --git a/config/set/php-cs-fixer/symfony-risky.php b/config/set/php-cs-fixer/symfony-risky.php index d0d4e28..7172645 100644 --- a/config/set/php-cs-fixer/symfony-risky.php +++ b/config/set/php-cs-fixer/symfony-risky.php @@ -30,6 +30,7 @@ ]); $ecsConfig->rule(\PhpCsFixer\Fixer\StringNotation\StringLengthToEmptyFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\StringNotation\NoTrailingWhitespaceInStringFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Alias\ArrayPushFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Alias\EregToPregFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\LanguageConstruct\ErrorSuppressionFixer::class); diff --git a/config/set/php-cs-fixer/symfony.php b/config/set/php-cs-fixer/symfony.php index eda889c..deb4119 100644 --- a/config/set/php-cs-fixer/symfony.php +++ b/config/set/php-cs-fixer/symfony.php @@ -55,6 +55,7 @@ 'yield_from', ], ]); + $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Phpdoc\AlignMultilineCommentFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocToCommentFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer::class); @@ -76,6 +77,7 @@ $ecsConfig->rule(\PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Import\FullyQualifiedStrictTypesFixer::class); $ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer::class, [ + 'allow_hidden_params' => true, 'remove_inheritdoc' => true, ]); $ecsConfig->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer::class); @@ -86,6 +88,7 @@ $ecsConfig->rule(\PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\NullableTypeDeclarationForDefaultNullValueFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\LanguageConstruct\NullableTypeDeclarationFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Semicolon\SemicolonAfterInstructionFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer::class); @@ -96,6 +99,7 @@ $ecsConfig->rule(\PhpCsFixer\Fixer\Import\NoUnneededImportAliasFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Comment\SingleLineCommentSpacingFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Operator\ConcatSpaceFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\CompactNullableTypeDeclarationFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer::class); @@ -161,7 +165,6 @@ $ecsConfig->rule(\PhpCsFixer\Fixer\Phpdoc\PhpdocVarWithoutNameFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Operator\StandardizeNotEqualsFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\SwitchContinueToBreakFixer::class); - $ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\TypeDeclarationSpacesFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer::class); diff --git a/config/set/php84.php b/config/set/php84.php new file mode 100644 index 0000000..18ccd74 --- /dev/null +++ b/config/set/php84.php @@ -0,0 +1,16 @@ +sets([ + PhpCsFixerSetList::PHP84_MIGRATION, + PhpCsFixerSetList::PHP80_MIGRATION_RISKY, + ]); +}; diff --git a/src/CustomSet.php b/src/CustomSet.php index 1789cfb..06156f1 100644 --- a/src/CustomSet.php +++ b/src/CustomSet.php @@ -47,14 +47,12 @@ public function getRules(): array 'null_adjustment' => 'always_last', 'sort_algorithm' => 'none', ], - 'nullable_type_declaration' => true, 'php_unit_test_case_static_method_calls' => [ 'call_type' => 'this', ], 'phpdoc_param_order' => true, 'not_operator_with_successor_space' => true, 'simplified_null_return' => true, - 'nullable_type_declaration_for_default_null_value' => true, 'phpdoc_line_span' => true, 'simplified_if_return' => true, 'fopen_flags' => [ diff --git a/src/PhpCsFixerRuleSetGenerator.php b/src/PhpCsFixerRuleSetGenerator.php index c4a68cf..cbbfebe 100644 --- a/src/PhpCsFixerRuleSetGenerator.php +++ b/src/PhpCsFixerRuleSetGenerator.php @@ -32,6 +32,7 @@ final class PhpCsFixerRuleSetGenerator '@PHP81Migration' => 'php81-migration.php', '@PHP82Migration' => 'php82-migration.php', '@PHP83Migration' => 'php83-migration.php', + '@PHP84Migration' => 'php84-migration.php', '@PHPUnit30Migration:risky' => 'phpunit30-migration-risky.php', '@PHPUnit32Migration:risky' => 'phpunit32-migration-risky.php', '@PHPUnit35Migration:risky' => 'phpunit35-migration-risky.php', diff --git a/src/PhpVersion.php b/src/PhpVersion.php index 3a3dd57..63cd8ba 100644 --- a/src/PhpVersion.php +++ b/src/PhpVersion.php @@ -76,6 +76,11 @@ final class PhpVersion */ public const PHP_83 = 80300; + /** + * @var int + */ + public const PHP_84 = 80400; + /** * @var int */ diff --git a/src/Set/ECSSetList.php b/src/Set/ECSSetList.php index 76e89d9..28b1b41 100644 --- a/src/Set/ECSSetList.php +++ b/src/Set/ECSSetList.php @@ -150,4 +150,9 @@ final class ECSSetList * @var string */ public const PHP_83 = __DIR__ . '/../../config/set/php83.php'; + + /** + * @var string + */ + public const PHP_84 = __DIR__ . '/../../config/set/php84.php'; } diff --git a/src/Set/PhpCsFixerSetList.php b/src/Set/PhpCsFixerSetList.php index 1a629ec..dd435f2 100644 --- a/src/Set/PhpCsFixerSetList.php +++ b/src/Set/PhpCsFixerSetList.php @@ -81,6 +81,11 @@ final class PhpCsFixerSetList */ public const PHP83_MIGRATION = __DIR__ . '/../../config/set/php-cs-fixer/php83-migration.php'; + /** + * @var string + */ + public const PHP84_MIGRATION = __DIR__ . '/../../config/set/php-cs-fixer/php84-migration.php'; + /** * @var string */