Skip to content

Commit

Permalink
relax: Add no_break_comment
Browse files Browse the repository at this point in the history
  • Loading branch information
realodix committed Jul 31, 2024
1 parent d2e5d98 commit c2c60d4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/RuleSet/Sets/Relax.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 14 additions & 0 deletions tests/Fixtures/Ruleset/relax_actual.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!';
Expand Down
14 changes: 14 additions & 0 deletions tests/Fixtures/Ruleset/relax_expected.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit c2c60d4

Please sign in to comment.