diff --git a/src/RuleSet/Sets/Relax.php b/src/RuleSet/Sets/Relax.php index 8f9afd1..b7e9ede 100644 --- a/src/RuleSet/Sets/Relax.php +++ b/src/RuleSet/Sets/Relax.php @@ -29,6 +29,7 @@ public function mainRules(): array 'attribute_empty_parentheses' => true, 'class_reference_name_casing' => true, 'combine_consecutive_unsets' => true, + 'no_break_comment' => true, 'no_unneeded_import_alias' => true, 'no_useless_concat_operator' => true, 'no_useless_else' => true, diff --git a/tests/Fixtures/Ruleset/relax_actual.php b/tests/Fixtures/Ruleset/relax_actual.php index e1ae9a2..7592240 100644 --- a/tests/Fixtures/Ruleset/relax_actual.php +++ b/tests/Fixtures/Ruleset/relax_actual.php @@ -179,6 +179,20 @@ public function comment__single_line_comment_style() */ } + public function control_structure__no_break_comment() + { + switch (true) { + case 1: + foo(); + case 2: + bar(); + // no break + break; + case 3: + baz(); + } + } + public function control_structure__control_structure_braces() { if (foo()) echo 'Hello!'; diff --git a/tests/Fixtures/Ruleset/relax_expected.php b/tests/Fixtures/Ruleset/relax_expected.php index 9b97dad..766c062 100644 --- a/tests/Fixtures/Ruleset/relax_expected.php +++ b/tests/Fixtures/Ruleset/relax_expected.php @@ -179,6 +179,20 @@ public function comment__single_line_comment_style() */ } + public function control_structure__no_break_comment() + { + switch (true) { + case 1: + foo(); + // no break + case 2: + bar(); + break; + case 3: + baz(); + } + } + public function control_structure__control_structure_braces() { if (foo()) {