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 262513

Summary: PHP formating adds extra indentation to the rest of the code
Product: php Reporter: Meowcate
Component: Formatting & IndentationAssignee: Tomas Mysik <tmysik>
Status: NEW ---    
Severity: normal CC: rob006
Priority: P3    
Version: 8.0   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: Before / After Format

Description Meowcate 2016-06-21 10:20:16 UTC
Created attachment 160114 [details]
Before / After Format

Using Netbeans for PHP, I ran into a specific condition where the IDE formating goes wrong.

The specific condition is shown in the attachement : with a nameless array in the return of the closure, indentations of all lines after this until the end of the file get two extra tabs. Each time this structure appears, it adds two more tabs starting after the return until the end.
In this example, I have this situation multiple times in my file, and the end get 16 extra tabs, forcing a manual indentation here.

I found a particularity to reproduce this bug, the nameless array in the return is important :
 - return $q->where(['photo IS NOT' => '']); -> bug
 - return []; -> bug
 - return array(); -> bug
 - return $q->where($array['photo IS NOT' => '']); -> bug
 - return $array[]; -> no bug
Comment 1 Tomas Mysik 2016-08-10 08:16:26 UTC
Could you please attach a sample file? Thanks.
Comment 2 rob006 2016-09-23 11:05:31 UTC
Looks like duplicate of https://netbeans.org/bugzilla/show_bug.cgi?id=247047