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 202556

Summary: Unexpected formatting for multiline statements
Product: php Reporter: aengel
Component: Formatting & IndentationAssignee: Ondrej Brejla <obrejla>
Status: RESOLVED DUPLICATE    
Severity: normal CC: schlaefer
Priority: P3    
Version: 7.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Screenshot of the editor settings
Export of my Editor > Other settings

Description aengel 2011-09-23 11:51:36 UTC
When using the formatter on a codesnippet with a multiline notation it formats in an unexpected way. It looks like the continuation indetation miscounts it's depth.

For example, this source code:

$oTest->methodCall(
	'parameter1', 
	array(
		'arrayKey1' => $sValue1,
		'arrayKey2' => $sValue2,
		'arrayKey3' => $sValue3
	)
);

Will be formatted (with our current settings) into:

$oTest->methodCall(
	'parameter1', array(
	'arrayKey1' => $sValue1,
	'arrayKey2' => $sValue2,
	'arrayKey3' => $sValue3
	)
);

This way it looks like the methodCall has 4 parameters.
We can't seem to adjust the formatter settings to keep the notation of the first example intact.
Comment 1 Petr Pisl 2011-09-23 12:35:02 UTC
You are right, this case is formatted wrong. I have different results (wrong as well). How do you have set up the continuation property?
Comment 2 aengel 2011-09-23 12:41:58 UTC
Created attachment 111096 [details]
Screenshot of the editor settings
Comment 3 aengel 2011-09-23 12:50:10 UTC
Created attachment 111097 [details]
Export of my Editor > Other settings
Comment 4 Petr Pisl 2011-09-23 12:53:14 UTC
Thanks.
Comment 5 aengel 2011-09-23 12:55:08 UTC
(In reply to comment #4)
> Thanks.

Thank you, for responding this fast, again.
Thumbs up. :)
Comment 6 Ondrej Brejla 2012-11-16 12:39:35 UTC
*** Bug 208168 has been marked as a duplicate of this bug. ***
Comment 7 Ondrej Brejla 2012-11-29 09:57:56 UTC
It has 2 parts. 

First is yours :) You have set "Formatting -> PHP-> Wrapping -> Method Call Arguments" to "Always". Then you will have every argument on a single line. Otherwise, when "Never" is selected, then it will never be wrapped and it will be in one line ;)

And the second part is mine. I have to fix that array indentation ;)
Comment 8 Ondrej Brejla 2013-06-19 11:37:55 UTC
Duplicate issue.

*** This bug has been marked as a duplicate of bug 196368 ***