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 247047 - Wrong formating of anonymous function in array
Summary: Wrong formating of anonymous function in array
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.0.1
Hardware: All All
: P3 normal with 4 votes (vote)
Assignee: Tomas Mysik
URL:
Keywords:
: 251403 254162 257023 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-09-11 19:43 UTC by rob006
Modified: 2016-04-02 02:07 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch (4.30 KB, patch)
2016-04-01 01:33 UTC, junichi11
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description rob006 2014-09-11 19:43:23 UTC
From: https://netbeans.org/bugzilla/show_bug.cgi?id=243593#c5

This change completely broke formatting, when anonymous function has array inside.

Correct formatting:

<?php

$foo = array(
	"foo" => function ($args) {
		print_r(array(1, 2, 3));
	},
	"foo" => function ($args) {
		echo "";
	},
);

?>

Current result:

<?php

$foo = array(
	"foo" => function ($args) {
		print_r(array(1, 2, 3));
	},
			"foo" => function ($args) {
		echo "";
	},
		);

?>
Comment 1 Ondrej Brejla 2014-09-11 19:49:55 UTC
Reproducible, thanks.
Comment 2 junichi11 2016-03-30 13:19:46 UTC
*** Bug 254162 has been marked as a duplicate of this bug. ***
Comment 3 junichi11 2016-03-30 14:01:19 UTC
*** Bug 251403 has been marked as a duplicate of this bug. ***
Comment 4 junichi11 2016-03-30 14:08:38 UTC
*** Bug 257023 has been marked as a duplicate of this bug. ***
Comment 5 junichi11 2016-04-01 01:33:01 UTC
Created attachment 159080 [details]
patch
Comment 6 junichi11 2016-04-01 01:36:09 UTC
I've created a patch.

Tomas, Could you please review it when you can make time?

Thanks.
Comment 7 Tomas Mysik 2016-04-01 05:49:02 UTC
Thanks a lot for the patch, will apply it soon.
Comment 8 Tomas Mysik 2016-04-01 05:58:28 UTC
Patch applied, thanks a lot for it Junichi! Great job as always!

http://hg.netbeans.org/web-main/rev/8e60cd9b56ba
Comment 9 Quality Engineering 2016-04-02 02:07:04 UTC
Integrated into 'main-silver', will be available in build *201604020001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/8e60cd9b56ba
User: Tomas Mysik <tmysik@netbeans.org>
Log: #247047 - Wrong formating of anonymous function in array

Patch contributed by junichi11@netbeans.org.