diff --git a/src/Configuration/Defaults/CommonAdditionalRules.php b/src/Configuration/Defaults/CommonAdditionalRules.php index 0a9bbf5..4054fed 100644 --- a/src/Configuration/Defaults/CommonAdditionalRules.php +++ b/src/Configuration/Defaults/CommonAdditionalRules.php @@ -11,6 +11,7 @@ use PHP_CodeSniffer\Standards\PSR12\Sniffs\Operators\OperatorSpacingSniff; use PhpCsFixer\Fixer\CastNotation\CastSpacesFixer; use PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer; +use PhpCsFixer\Fixer\FunctionNotation\NullableTypeDeclarationForDefaultNullValueFixer; use PhpCsFixer\Fixer\FunctionNotation\UseArrowFunctionsFixer; use PhpCsFixer\Fixer\FunctionNotation\VoidReturnFixer; use PhpCsFixer\Fixer\Import\FullyQualifiedStrictTypesFixer; @@ -60,5 +61,6 @@ class CommonAdditionalRules extends Rules implements AdditionalRules "arguments", ], ], + NullableTypeDeclarationForDefaultNullValueFixer::class => null, ]; } diff --git a/tests/codestyle/fixtures/nullableTypeForDefaultNull/actual.php b/tests/codestyle/fixtures/nullableTypeForDefaultNull/actual.php new file mode 100644 index 0000000..ca20b8b --- /dev/null +++ b/tests/codestyle/fixtures/nullableTypeForDefaultNull/actual.php @@ -0,0 +1,14 @@ + null, ], $config->options()["rules"], ); @@ -123,6 +125,7 @@ public function testFilteringAdditionalRulesConfiguration(): void "arguments", ], ], + NullableTypeDeclarationForDefaultNullValueFixer::class => null, ], $config->options()["rules"], ); @@ -174,6 +177,7 @@ public function testExtendingAdditionalRulesConfiguration(): void "arguments", ], ], + NullableTypeDeclarationForDefaultNullValueFixer::class => null, HeredocToNowdocFixer::class => null, ], $config->options()["rules"], @@ -233,6 +237,7 @@ public function testExtendingWithOptionsAdditionalRulesConfiguration(): void "arguments", ], ], + NullableTypeDeclarationForDefaultNullValueFixer::class => null, NoMixedEchoPrintFixer::class => [ "use" => "echo", ],