-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #5567 Fix order of BracesFixer and ClassDefinitionFixer (Daeroni)
This PR was merged into the 2.18 branch. Discussion ---------- Fix order of BracesFixer and ClassDefinitionFixer If BracesFixer is configured with "position_after_functions_and_oop_constructs": "same", it would be overwritten by ClassDefinitionFixer putting the brace on the next line unless the ClassDefinitionFixer is run before BracesFixer. It seems ClassDefinitionFixer was previously run implicitly before BracesFixer, but 701708e changed the priority of BracesFixer from negative to positive and the order of the two fixers were reversed. Commits ------- 01d34da Fix order of BracesFixer and ClassDefinitionFixer
- Loading branch information
Showing
4 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
tests/Fixtures/Integration/priority/class_definition,braces.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--TEST-- | ||
Integration of fixers: class_definition,braces. | ||
--RULESET-- | ||
{"class_definition": true, "braces": {"position_after_functions_and_oop_constructs": "same"}} | ||
--EXPECT-- | ||
<?php | ||
|
||
class Foo { | ||
} | ||
|
||
--INPUT-- | ||
<?php | ||
|
||
class Foo{ | ||
} |