Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PHP] Match operator formatting with arrays is broken #5186

Closed
NReib opened this issue Jan 3, 2023 · 1 comment · Fixed by #5685
Closed

[PHP] Match operator formatting with arrays is broken #5186

NReib opened this issue Jan 3, 2023 · 1 comment · Fixed by #5685
Assignees
Labels
kind:bug Bug report or fix PHP [ci] enable extra PHP tests (php/php.editor)
Milestone

Comments

@NReib
Copy link

NReib commented Jan 3, 2023

Apache NetBeans version

Apache NetBeans 16

What happened

If the value of a match arm is an array, NB does not format it well.

How to reproduce

Before:

<?php
match(123){
	'test' => [
		'key' => 'val',
		],
};
?>

After Alt+Shift+F:

<?php
match(123){
	'test' => [
'key' => 'val',
	],
};
?>

Did this work correctly in an earlier version?

No / Don't know

Operating System

Mageia 8 (Linux)

JDK

openjdk version "11.0.17" 2022-10-18 LTS

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

No response

Are you willing to submit a pull request?

No

Code of Conduct

Yes

@NReib NReib added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Jan 3, 2023
@mbien mbien added the PHP [ci] enable extra PHP tests (php/php.editor) label Jan 4, 2023
@KacerCZ
Copy link
Contributor

KacerCZ commented Jan 7, 2023

Reproducible.
Thanks for your report.

@KacerCZ KacerCZ removed the needs:triage Requires attention from one of the committers label Jan 7, 2023
@junichi11 junichi11 self-assigned this Mar 20, 2023
@junichi11 junichi11 added this to the NB18 milestone Mar 20, 2023
junichi11 added a commit to junichi11/netbeans that referenced this issue Mar 20, 2023
junichi11 added a commit to junichi11/netbeans that referenced this issue Mar 20, 2023
- apache#5186

e.g.
```php
match(true){
	'test' => [
		'key' => 'value',
		],
};
```

Before: An array is broken
```php
match (true) {
    'test' => [
'key' => 'value',
    ],
};
```

After:
```php
match (true) {
    'test' => [
        'key' => 'value',
    ],
};
```
junichi11 added a commit to junichi11/netbeans that referenced this issue Mar 20, 2023
- apache#5186

e.g.
```php
match(true){
	'test' => [
		'key' => 'value',
		],
};
```

Before: An array is broken
```php
match (true) {
    'test' => [
'key' => 'value',
    ],
};
```

After:
```php
match (true) {
    'test' => [
        'key' => 'value',
    ],
};
```
@junichi11 junichi11 linked a pull request Mar 20, 2023 that will close this issue
tmysik added a commit that referenced this issue Mar 21, 2023
…in-match-arm

Fix an array formatting in a match arm #5186
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Bug report or fix PHP [ci] enable extra PHP tests (php/php.editor)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants