This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The final code should look like this: $checks[] = new G_Check("PHP version", version_compare(PHP_VERSION, MIN_PHP_VERSION, ">="), "The minimum version of PHP is ".MIN_PHP_VERSION); If one starts typing, the first <enter> is indented by 4 spaces (or 1 tab). I manually adjust it to 8 spaces (or 2 tabs), but the next <enter> is indented again by 4 spaces instead of 8, so the code look like this: $checks[] = new G_Check("PHP version", version_compare(PHP_VERSION, MIN_PHP_VERSION, ">="), "The minimum version of PHP is ".MIN_PHP_VERSION); One has to manually adjust every line, so it's very annoying (it works perfectly for Java). P2 because it might be some bigger problem if the indentation does not follow the previous line. Product Version: NetBeans IDE 6.8 Beta (Build 200910020947) Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01 System: Linux version 2.6.28-15-generic running on amd64; UTF-8; cs_CZ (nb)
More serious example: function test() { do { echo "test"; } while ($condition); // press ENTER here | // you will get here }
moreover, if you incoke formatting on the code above you will get this: <? function test() { do { echo "test"; } while ($condition);| //press enter here | //you end up here } ?> the formatting issue was reported in 173906
Integrated into 'main-golden', will be available in build *200910160201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/0db90a9db262 User: Filip Zamboj <fzamboj@netbeans.org> Log: #173937 unit test created but commented out as the issue is still open
One more example: $arr = array(new ArrayIterator(array()), new ArrayObject(array()));| // <- ENTER here => no indentation
Tomasi can you provide full context for the last example? I tried <?php function functionName($param) { $arr = array(new ArrayIterator(array()), new ArrayObject(array()));| } ?> and some cases and didn't see any problem
<?php $arr = array(new ArrayIterator(array()), new ArrayObject(array())); ?> Product Version: NetBeans IDE Dev (Build 091016) Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01 System: Linux version 2.6.28-15-generic running on amd64; UTF-8; cs_CZ (nb)
I have separated the issue with while into issue #175118. The issue with $arr = array(new ArrayIterator(array()), new ArrayObject(array())); as was mentioned by tmysik, now works after my fixes in indentation. I will create test for it. There is still the original problem with an expression over more lines.
> There is still the original problem with an expression over more lines. Personally, I would prefer behaviour like in Java - I mean indent by 8 spaces (2 tabs), not 4 (1), for expressions over more lines. Thanks a lot.
Another example: <?php // 2b) load configuration from config.ini file Environment::loadConfig(); // <-- press <enter> here ?>
After committing change ae0db6ba4faa this can be marked as fixed. All mentioned are working now.
verified Product Version: NetBeans IDE Dev (Build 091119-840bbe3ddcb3) Java: 1.5.0_17-ea; Java HotSpot(TM) 64-Bit Server VM 1.5.0_17-ea-b01