Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #5593 SingleLineThrowFixer - fix handling anonymous classes (kuba…
…werlos) This PR was squashed before being merged into the 2.18 branch. Discussion ---------- SingleLineThrowFixer - fix handling anonymous classes Is this a right solution or `SingleLineThrowFixer` should not remove new lines from anonymous class definition? Ping @nicolas-grekas for an opinion (as you are the person who originally [requested](#3988) this fixer). Commits ------- c73f60a SingleLineThrowFixer - fix handling anonymous classes
- Loading branch information
Showing
5 changed files
with
85 additions
and
37 deletions.
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
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
20 changes: 20 additions & 0 deletions
20
tests/Fixtures/Integration/priority/single_line_throw,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,20 @@ | ||
--TEST-- | ||
Integration of fixers: single_line_throw,braces. | ||
--RULESET-- | ||
{"braces": true, "single_line_throw": true} | ||
--REQUIREMENTS-- | ||
{"php": 70000} | ||
--EXPECT-- | ||
<?php | ||
throw new class() extends Exception { | ||
protected $message = "Custom message"; | ||
}; | ||
|
||
--INPUT-- | ||
<?php | ||
throw | ||
new class() | ||
extends Exception | ||
{ | ||
protected $message = "Custom message"; | ||
}; |