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 249049 - Array concatenation and continuation indent incorrect
Summary: Array concatenation and continuation indent incorrect
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.0.1
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-01 21:41 UTC by nicholas.alipaz
Modified: 2016-11-23 12:01 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nicholas.alipaz 2014-12-01 21:41:02 UTC
I have the following PHP code:

<?php


$api = array(
  'api' => 2,
  'groups' => array(
    'something' => array(
      'peter' => '1',
    ),
  ),
  'migrations' => array(
    // Define something migrations.
    'ThisThing' => $common_arguments + array(
    'description' => t('Some desc.'),
    'source_vocabulary' => 1,
    'destination_vocabulary' => 'meetings',
    ),
  ),
);

When running Source -> Format on this above, the array properties in ThisThing do not get indented properly.  The above it actual output after running the format.  I believe it due to the array concatenation.
Comment 1 simohe 2016-04-14 15:50:36 UTC
Another example:

from this:

        $form = $this->createForm(
        new ActionType($entity), $entity, array(
        'action' => $action,
        'method' => 'POST',
        )
        );

formating generates this:

        $form = $this->createForm(
                new ActionType($entity), $entity, array(
            'action' => $action,
            'method' => 'POST',
                )
        );

instead of this:

        $form = $this->createForm(
                new ActionType($entity), $entity, array(
                    'action' => $action,
                    'method' => 'POST',
                )
        );

some relevant settings:
    Continuation Indentation: 8
    Array Decleration Indentation: 4
    Number of Spaces per Indent: 4
Comment 2 Tomas Mysik 2016-06-10 09:57:36 UTC
Reproducible. Thanks for reporting.
Comment 3 junichi11 2016-11-23 11:59:43 UTC
(In reply to simohe from comment #1)
> Another example:
> 
> from this:
> 
>         $form = $this->createForm(
>         new ActionType($entity), $entity, array(
>         'action' => $action,
>         'method' => 'POST',
>         )
>         );
> 
> formating generates this:
> 
>         $form = $this->createForm(
>                 new ActionType($entity), $entity, array(
>             'action' => $action,
>             'method' => 'POST',
>                 )
>         );
> 
> instead of this:
> 
>         $form = $this->createForm(
>                 new ActionType($entity), $entity, array(
>                     'action' => $action,
>                     'method' => 'POST',
>                 )
>         );
> 
> some relevant settings:
>     Continuation Indentation: 8
>     Array Decleration Indentation: 4
>     Number of Spaces per Indent: 4

@simohe
I would like to separate your problem from this issue. So could you submit it as a new issue? Then, please add me to CC if you submit it.

Thanks.