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 243593 - Wrong formating of anonymous function
Summary: Wrong formating of anonymous function
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-05 21:49 UTC by jDanek
Modified: 2014-09-11 19:16 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Image with formatting differences (73.53 KB, image/png)
2014-04-05 21:49 UTC, jDanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jDanek 2014-04-05 21:49:04 UTC
Created attachment 146573 [details]
Image with formatting differences

Since version 7.4 is not indented properly code inside the anonymous function, as shown in the attached picture. It did not help importing settings from version 7.3
Comment 1 Ondrej Brejla 2014-04-11 08:19:42 UTC
Reproducible.

Test case:

<?php

$foo = array(
    "foo" => function ($args) {
echo "";
},
    "foo" => function ($args) {
echo "";
},
);

?>
Comment 2 jDanek 2014-04-12 18:43:11 UTC
Properly it should be like this:

<?php

$foo = array(
    "foo" => function ($args) {
        echo "";
    },
    "foo" => function ($args) {
        echo "";
    },
);
Comment 3 Ondrej Brejla 2014-07-22 14:28:14 UTC
Fixed in web-main #7f3c457364ef
Comment 4 Quality Engineering 2014-07-23 02:07:58 UTC
Integrated into 'main-silver', will be available in build *201407230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/7f3c457364ef
User: Ondrej Brejla <obrejla@netbeans.org>
Log: #243593 - Wrong formating of anonymous function
Comment 5 rob006 2014-09-11 19:08:59 UTC
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 6 Ondrej Brejla 2014-09-11 19:15:31 UTC
Do not reopen fixed issues. File ne P3. Thanks.