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.

Bug 198313

Summary: Code formatting should support different spacing settings for logical operators
Product: php Reporter: negge <negge>
Component: Formatting & IndentationAssignee: Ondrej Brejla <obrejla>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: P3    
Version: 7.0   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Illustrates where the option should be

Description negge 2011-05-04 12:17:11 UTC
Created attachment 108101 [details]
Illustrates where the option should be

When configuring code formatting for the PHP language, the ability to insert spaces around logical operators (||, && etc.) is missing. 

If you go to Tools -> Options -> Editor, then set Language to "PHP" and Category to "Spaces", you see that under "Around Operators" one can only choose to put spaces around unary, binary and ternary operators.

The reason I noticed this is that I would want Netbeans to re-format the following snippet of code from this:

if($value > 0.1 && $value < 0.3) {

to this:

if( $value>0.1 && $value<0.3 ) {

Currently the closest I can get is this:

if( $value>0.1&&$value<0.3 ) {

I attached a screenshot to better illustrate where the change should go.
Comment 1 Ondrej Brejla 2012-11-29 11:42:13 UTC
It's not so common use case to have an extra option for that. Java support doesn't have it either. Sorry.