Skip to content

Wrong indentation after multi-line function call #6731

@php4fan

Description

@php4fan

Apache NetBeans version

Apache NetBeans 19

What happened

After the following code:

<?php

$result = someFunction(
    "example {$postId}"
);

the next line after that should have zero indentation.

Instead, it gets indented with 4 spaces, i.e. one indentation.

A real-world use case might be something like this:

<?php

$result = queryDatabase(
    "SELECT field1, field2, field3, field4, field5 "
        . "FROM table AS t1 "
        . "JOIN table2 AS t2 ON t2.whatever_id = t1.id "
        . "JOIN table2 AS t3 ON t3.whatever_id = t2.id "
        . "WHERE t1.id = {$something['id']}"
);

after which I get even 2 indentations (i.e. 8 spaces).

How to reproduce

In a PHP file type this:

<?php

$result = someFunction(
    "example {$postId}"
);

and then add a newline. Observe how the new line gets automatically indented.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Manjaro Linux

JDK

21; OpenJDK 64-Bit Server VM 21+35

Apache NetBeans packaging

Third-party package

Anything else

No response

Are you willing to submit a pull request?

No

Metadata

Metadata

Assignees

Labels

PHP[ci] enable extra PHP tests (php/php.editor)kind:bugBug report or fix

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions