Closed reprintsev closed 6 months ago
Hi! What would be the expected behaviour? Please consider MergeParenCloseWithCurlyOpen is intended to work with if/else, not try/catch
Sorry I finally understood your point.
MergeParenCloseWithCurlyOpen is intended to work with if/else, not try/catch, so I don't know if it'd be something to change. It's been a lot of years it behaves this way.
MergeParenCloseWithCurlyOpen is intended to work with if/else, not try/catch, so I don't know if it'd be something to change. It's been a lot of years it behaves this way.
Hi! I'm understood, thank you! Is it possible to add a new option for this case?
I've found that the culprit for this problem is the "ResizeSpaces". I'm very sorry I can't touch this very pass to fit this need at this moment. I should add another new pass just for this specific case, and I'm currently just fixing bugs for the this package.
NormalizeLnAndLtrimLines
----
MergeParenCloseWithCurlyOpen
<?php
try {
// something
}
catch (Exception $e){
// something
}
finally {
// something
}
MergeParenCloseWithCurlyOpen
----
ResizeSpaces
<?php
try {
// something
} catch (Exception $e) {
// something
} finally {
// something
}
ResizeSpaces
----
SplitCurlyCloseAndTokens
<?php
When using the
--exclude=MergeParenCloseWithCurlyOpen
option, the try/catch/finally still reformatted fromto