Skip to content

Commit

Permalink
relaxplus: 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 67da813
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/RelaxPlus.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function mainRules(): array

// Cleanup
'phpdoc_no_alias_tag' => ['replacements' => ['type' => 'var', 'link' => 'see']],
'no_break_comment' => true,
'general_phpdoc_annotation_remove' => [
'annotations' => [
// https://github.com/doctrine/coding-standard/blob/3e88327/lib/Doctrine/ruleset.xml#L227
Expand Down
14 changes: 14 additions & 0 deletions tests/Fixtures/Ruleset/relaxplus_actual.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@ public function basic__numeric_literal_separator()
******/
public function comment__multiline_comment_opening_closing() {}

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__no_superfluous_elseif()
{
if (true) {
Expand Down
14 changes: 14 additions & 0 deletions tests/Fixtures/Ruleset/relaxplus_expected.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@ public function basic__numeric_literal_separator()
*/
public function comment__multiline_comment_opening_closing() {}

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__no_superfluous_elseif()
{
if (true) {
Expand Down

0 comments on commit 67da813

Please sign in to comment.