PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » PHP » PHP_Beautifier » Bug #4931

Formatting problem with switches

Details

Submitted2005-07-27 16:26 UTC
Fromjustinh at superglobals dot com
Assignedclbustos
StatusClosed
PackagePHP_Beautifier
PHP VersionIrrelevant
OSn/a
Roadmaps(Not assigned)

Comments

[2005-07-27 16:26 UTC] justinh at superglobals dot com

Description:
------------
switch() statement indenting seems to be pretty buggy. I tried running Spreadsheet_Excel_Reader (http://sourceforge.net/projects/phpexcelreader/) though PHP_Beautifier and it hosed the indentation. I was able to reproduce one of the problems with the sample code below, but there's definately something else wrong with switch statement indenting that I can't identify.

Test script:
---------------
switch ($var) {
case 1:
default:
break;
}

Expected result:
----------------
switch ($var) {
case 1:
default:
break;
}

Actual result:
--------------
switch ($var) {
case 1:
default:
break;
}

[2005-07-27 16:31 UTC] justinh at superglobals dot com

switch ($var) {
case 3:
// comment
case 4:
break;
}

This will also break indentation.

[2005-09-15 00:06 UTC] clbustos at php dot net

Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pear.php.net/get/PHP_Beautifier

Fixed on 0.1.7