PSR auto-formatting for NetBeans

用于 PSR 1&2 的 NetBeans 配置设置。「NetBeans configuration settings for PSR 1&2」

Github星跟蹤圖

PSR auto-formatting for 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.

Requirements

  • NetBeans (Tested and developed on v8.2 and v8.1 but should work fine on other versions too!)

License

All things have a license I guess, so keeping it plain and simple, these files are released under the MIT license.

Support

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.

Installation

  • Download the latest release (specifically the ZIP version) to your machine (If you're using Netbeans 8.1 or below see the notes below about a bug and a provided workaround version).
  • Open up the NetBeans IDE on your computer
  • From the top menu, click on Tools and then from the menu that appears click Options
  • When the Options window appears click on the Import button at the bottom left.
  • When the Import window appears click on the Browse button and select the downloaded zip archive that you downloaded in the first step.
  • Under the Select options to import:, check the All check box and then click Ok and then Apply.
  • You should then be prompted to restart the IDE, restart and enjoy your new auto-formatting skills ;)

Using NetBeans 8.1 (and lower)?

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.

Preparing the source code for 'import'

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.

主要指標

概覽
名稱與所有者allebb/netbeans-psr-formatting
主編程語言
編程語言 (語言數: 0)
平台
許可證MIT License
所有者活动
創建於2015-01-23 13:59:28
推送於2017-01-05 22:49:54
最后一次提交2017-01-05 22:49:53
發布數3
最新版本名稱v1.0.2 (發布於 )
第一版名稱v1.0.0 (發布於 )
用户参与
星數150
關注者數25
派生數16
提交數21
已啟用問題?
問題數13
打開的問題數3
拉請求數1
打開的拉請求數0
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?