diff --git a/src/Fixer/Commenting/RemoveUselessDefaultCommentFixer.php b/src/Fixer/Commenting/RemoveUselessDefaultCommentFixer.php index ac3aa1c8..ef1f503e 100644 --- a/src/Fixer/Commenting/RemoveUselessDefaultCommentFixer.php +++ b/src/Fixer/Commenting/RemoveUselessDefaultCommentFixer.php @@ -69,6 +69,7 @@ public function fix(SplFileInfo $fileInfo, Tokens $tokens): void // remove token $tokens->clearAt($index); + $tokens->removeTrailingWhitespace($index, "\n"); } } diff --git a/tests/Fixer/Commenting/RemoveUselessDefaultCommentFixer/Fixture/todo_change_autogenerated_comment.php.inc b/tests/Fixer/Commenting/RemoveUselessDefaultCommentFixer/Fixture/todo_change_autogenerated_comment.php.inc index 84b83da3..45bbfb3c 100644 --- a/tests/Fixer/Commenting/RemoveUselessDefaultCommentFixer/Fixture/todo_change_autogenerated_comment.php.inc +++ b/tests/Fixer/Commenting/RemoveUselessDefaultCommentFixer/Fixture/todo_change_autogenerated_comment.php.inc @@ -10,6 +10,5 @@ namespace Symplify\CodingStandard\Tests\Fixer\Commenting\RemovePHPStormTodoComme namespace Symplify\CodingStandard\Tests\Fixer\Commenting\RemovePHPStormTodoCommentFixer\Fixture; - // TODO some other notes ?> diff --git a/tests/Fixer/Commenting/RemoveUselessDefaultCommentFixer/Fixture/useless_class_comment.php.inc b/tests/Fixer/Commenting/RemoveUselessDefaultCommentFixer/Fixture/useless_class_comment.php.inc index 00854017..87e95f09 100644 --- a/tests/Fixer/Commenting/RemoveUselessDefaultCommentFixer/Fixture/useless_class_comment.php.inc +++ b/tests/Fixer/Commenting/RemoveUselessDefaultCommentFixer/Fixture/useless_class_comment.php.inc @@ -38,27 +38,22 @@ class SomeClass5 namespace Symplify\CodingStandard\Tests\Fixer\Commenting\RemoveUselessClassCommentFixer\Fixture; - class SomeClass1 { } - class SomeClass2 { } - class SomeClass3 { } - class SomeClass4 { } - class SomeClass5 { } diff --git a/tests/Issues/Fixture/remove_useless_default_comment_and_statement_indentation.php.inc b/tests/Issues/Fixture/remove_useless_default_comment_and_statement_indentation.php.inc new file mode 100644 index 00000000..1dcbf435 --- /dev/null +++ b/tests/Issues/Fixture/remove_useless_default_comment_and_statement_indentation.php.inc @@ -0,0 +1,12 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + yield [__DIR__ . '/Fixture/remove_useless_default_comment_and_statement_indentation.php.inc']; + } + + public function provideConfig(): string + { + return __DIR__ . '/config/config_remove_useless_default_comment_and_statement_indentation.php'; + } +} diff --git a/tests/Issues/config/config_remove_useless_default_comment_and_statement_indentation.php b/tests/Issues/config/config_remove_useless_default_comment_and_statement_indentation.php new file mode 100644 index 00000000..28b1a5f7 --- /dev/null +++ b/tests/Issues/config/config_remove_useless_default_comment_and_statement_indentation.php @@ -0,0 +1,12 @@ +rule(RemoveUselessDefaultCommentFixer::class); + $ecsConfig->rule(StatementIndentationFixer::class); +};