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

Bug #17780 Associative arrays indent incorrectly with BSD, GNU, WS filters
Submitted: 2010-08-21 21:51 UTC
From: rboudrie Assigned:
Status: Open Package: PHP_Beautifier (version 0.1.15)
PHP Version: 5.3.2 OS: Fedora 12
Roadmaps: (Not assigned)    
Subscription  


 [2010-08-21 21:51 UTC] rboudrie (Rob Boudrie)
Description: ------------ Associative arrays constructs like $foo{"bar"} treat the braces used for the associative indent as nexting braces with filters other that the default. I see this problem with BSD, WS and GNU. I am using the BSD filter for the demo of the problem. Note how $vector{$foo} is broken in the php_beautify result with the BSD filter below. This bug makes PhpBeautifier useless for those of us who loathe the K&R style indentation and use lots of associative arrays in our code. If this could be fixed, it would greatly improve the product. Thanks. Test script: --------------- [root@dogs /tmp]# cat in.php <?php $foo="Testing"; $vector{$foo}="bar"; if($vector{$foo} == "bar") { print "Yes, it is bar\n"; } ?> Expected result: ---------------- <?php $foo = "Testing"; $vector{$foo} = "bar"; if ($vector{$foo} == "bar") { print "Yes, it is bar\n"; } ?> Actual result: -------------- [root@dogs /tmp]# php_beautifier --filters "IndentStyles(style=bsd)" in.php <?php $foo = "Testing"; $vector { $foo} = "bar"; if ($vector { $foo} == "bar") { print "Yes, it is bar\n"; } ?> [root@dogs /tmp]#

Comments