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.
Summary: | Wrong new line behaviour for namespaces | ||
---|---|---|---|
Product: | php | Reporter: | av3nger |
Component: | Formatting & Indentation | Assignee: | Tomas Mysik <tmysik> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | av3nger, junichi11, Pimmetje, tmysik |
Priority: | P3 | ||
Version: | 8.0 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | patch for proposal |
Description
av3nger
2014-04-10 22:27:27 UTC
Reproducible Product Version: NetBeans IDE Dev (Build 201404100001) Java: 1.8.0; Java HotSpot(TM) Client VM 25.0-b70 Runtime: Java(TM) SE Runtime Environment 1.8.0-b132 System: Linux version 3.2.0-60-generic-pae running on i386; UTF-8; en_US (nb) Trying to fix auto formatting according to PSR-2 standards. Because of this bug, namespace part can not be configured like it is explained in: http://www.php-fig.org/psr/psr-2/ <?php namespace Vendor\Package; class ClassName { public $foo = null; } Created attachment 159105 [details]
patch for proposal
This is related to the issue 235710.
I think that it is the special case for Laravel4. So, if Blank Lines settings for both "After Open PHP Tag" and "Before Namespace" are 0, it should be formatted for PSR-2 by default.
My proposal:
Add the new option("Between Open PHP Tag and Namespace") to "Spaces".
But it may not be a proper place...
Thanks.
I've created a patch for proposal. Tomas, could you please review it when you can make time? Thanks! Will apply it, thanks a lot Junichi, as always! Patch applied, thanks a lot, Junichi! http://hg.netbeans.org/web-main/rev/4ee4f3cc55ed Integrated into 'main-silver', will be available in build *201604050001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/4ee4f3cc55ed User: Tomas Mysik <tmysik@netbeans.org> Log: #243744 - Wrong new line behaviour for namespaces Patch contributed by junichi11@netbeans.org. |