Home » PHP » PHP_Beautifier » Bug #3257
Comments between if and elseif screws up formatting
Details
| Submitted | 2005-01-21 03:01 UTC |
|---|---|
| From | brandon at osuosl dot org |
| Assigned | clbustos |
| Status | Closed |
| Package | PHP_Beautifier |
| PHP Version | 5.0.2 |
| OS | Debian Unstable |
| Roadmaps | (Not assigned) |
Comments
[2005-01-21 03:01 UTC] brandon at osuosl dot org
Description:
------------
The beautifier will cascade and start moving the indentations over if there is a comment between if {} and elseif {}
Reproduce code:
---------------
<?php
class Foo {
var $foobar = 0;
function Foo($a, $b) {
if ($a) {
dostuff();
}
// $a no good
elseif {
dootherstuff();
}
// $c maybe
elseif {
yea();
}
}
function bar() {
echo "Hello";
}
}
?>
Expected result:
----------------
Indentations being all under the class
Actual result:
--------------
$ php_beautifier -l "Pear() ArrayNested() ListClassFunction" foo.php |less
<?php
/*
* Class and Function List:
* Function list:
* - Foo()
* - bar()
* Classes list:
* - Foo
*/
class Foo {
var $foobar = 0;
function Foo($a, $b)
{
if ($a) {
dostuff();
}
// $a no good
elseif {
dootherstuff();
}
// $c maybe
elseif {
yea();
}
}
function bar()
{
echo "Hello";
}
}
?>