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.
Since NetBeans 8.0 it's not possible to write the namespace in the line after the php open tag when using the formatting feature. Did work in 7.4. In the formatting options I selected Language: PHP and Category: Blank Lines. When I set "Before Namespace" and "After Open Tag" to 0, I get: <?php namespace MyProject; When I set one of these values to 1, I get: <?php namespace MyProject; But I want this (without a blank line): <?php namespace MyProject; It seems that this isn't possible anymore.
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.