PSR 1和2的NetBeans配置设置
This repository provides source code auto-formatting settings for PHP PSR1 and PSR2 standards.
Although NetBeans does not provide automatic formatting support for all of the PSR1 and PSR2 ‘rules’ (eg. refactoring class and method name case) I have done my best to implement as much as possible.
The result of using this configuration is, once imported you can then use the Source > Format
function (ALT
+SHIFT
+F
on Windows and Linux) or (CTRL
+SHIFT
+F
on Mac) in NetBeans the PHP code will automatically be formatted to match PSR1/PSR2 syntax format.
All things have a license I guess, so keeping it plain and simple, these files are released under the MIT license.
I am happy to provide support via. my personal email address, so if you need a hand or want to give me some feedback please drop me an email at: ballen@bobbyallen.me.
Tools
and then from the menu that appears click Options
Import
button at the bottom left.Browse
button and select the downloaded zip archive that you downloaded in the first step.Select options to import:
, check the All
check box and then click Ok
and then Apply
.There is an issue in Netbeans versions 8.1 (and lower) in which the namespace
new-line configuration does not work (a bug) of which has since been
fixed in Netbeans 8.2. As a workaround however, release v1.0.1 uses a single blank line to split the namespace
from the first line of which is recommended to use.
In order to import the settings into NetBeans, compress the root directory of the src
directory into a zip file of which can then be used to import into NetBeans as shown below in the installation guide.