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 - PHP formating adds extra indentation to the rest of the code
Summary: PHP formating adds extra indentation to the rest of the code
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-21 10:20 UTC by Meowcate
Modified: 2016-09-23 11:05 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Before / After Format (67.35 KB, image/png)
2016-06-21 10:20 UTC, Meowcate
Details

Note You need to log in before you can comment on or make changes to this bug.
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