Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.1.15

Bug #14429 Braces within strings break
Submitted: 2008-07-31 12:11 UTC Modified: 2008-08-19 23:17 UTC
From: thorie Assigned: clbustos
Status: Closed Package: PHP_Beautifier (version 0.1.14)
PHP Version: 5.2.0 OS: Debian Linux
Roadmaps: 1.0.0RC1    
Subscription  


 [2008-07-31 12:11 UTC] thorie (Takahiro Horie)
Description: ------------ If I have a string with two variables in braces and one of them is an array and this string is within a switch statement, then the braces become indented as if they were ending the switch statement. I run the test script with command: php_beautifier test.php test-output.php Test script: --------------- <?php $var = new StdClass(); $var->text = 'hello'; $ok['what'] = 'ok'; switch($something){ case 'one': echo "{$var->text} world {$ok['what']}"; break; default: break; } ?> Expected result: ---------------- <?php $var = new StdClass(); $var->text = 'hello'; $ok['what'] = 'ok'; switch ($something) { case 'one': echo "{$var->text} world {$ok['what']}"; break; default: break; } Actual result: -------------- <?php $var = new StdClass(); $var->text = 'hello'; $ok['what'] = 'ok'; switch ($something) { case 'one': echo "{$var->text } world {$ok['what'] } "; break; default: break; }

Comments

 [2008-07-31 22:21 UTC] clbustos (Claudio Bustos)
Thank you for taking the time to report a problem with the package. Unfortunately you are not using a current version of the package -- the problem might already be fixed. Please download a new version from http://pear.php.net/packages.php If you are able to reproduce the bug with one of the latest versions, please change the package version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PEAR. With PHP_Beautifier 0.1.14 I obtain <?php $var = new StdClass(); $var->text = 'hello'; $ok['what'] = 'ok'; switch ($something) { case 'one': echo "{$var->text} world {$ok['what']}"; break; default: break; } ?> Please, update your package and tell me what happens
 [2008-08-01 07:40 UTC] thorie (Takahiro Horie)
That's strange, because I am using 0.1.14. $ pear list INSTALLED PACKAGES, CHANNEL PEAR.PHP.NET: ========================================= PACKAGE VERSION STATE Archive_Tar 1.3.1 stable Console_Getopt 1.2 stable Image_GraphViz 1.2.1 stable Log 1.11.0 stable PEAR 1.4.11 stable PHP_Beautifier 0.1.14 beta Does PHP_Beautifier depend on anything else that might not be updated on my system? Perhaps it's PHP 5.2.0 that I am using?
 [2008-08-01 10:23 UTC] clbustos (Claudio Bustos)
Strange. My configuration is: PHP 5.2.4-2ubuntu5.3 with Suhosin-Patch 0.9.6.2 (cli) (built: Jul 23 2008 06:46:18) with PHP_Beautifier 0.1.14 the output of your file is ~ $ php_beautifier test_14429.php <?php $var = new StdClass(); $var->text = 'hello'; $ok['what'] = 'ok'; switch ($something) { case 'one': echo "{$var->text} world {$ok['what']}"; break; default: break; } ?> Mhhh.... can you send me the original file?
 [2008-08-01 11:08 UTC] thorie (Takahiro Horie)
Oh, it seems to only happen with -l "Pear()" $ php_beautifier -l "Pear()" test.php <?php $var = new StdClass(); $var->text = 'hello'; $ok['what'] = 'ok'; switch ($something) { case 'one': echo "{$var->text } world {$ok['what'] } "; break; default: break; }
 [2008-08-01 11:19 UTC] clbustos (Claudio Bustos)
Ufff... the old and buggy Pear filter. Ok, I'll include the fix on 1.0.0RC1
 [2008-08-19 23:17 UTC] clbustos (Claudio Bustos)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.