|
To configure PHP_CodeSniffer:
- From the Menu-bar, select Window | Preferences | PHP Tools | PHP_CodeSniffer.
The PHP CodeSniffer dialog is displayed.
- Select a PHP executable from the drop-down menu for running PHP_CodeSniffer.
- If you wish to print PHP output to the console for the purpose of debugging, select the print PHP output to console checkbox.
- Click here to download a PEAR library.
- In the PHP CodeSniffer preferences dialog, click PEAR Libraries.
The PEAR dialog is displayed.
- Click New.
The New Library Path dialog is displayed.
- Name a name for the new PEAR library, enter the path to the PEAR library you downloaded, and click OK.
- Back in the PEAR dialog, click Apply.
- In the PHP CodeSniffer dialog, click the PEAR Library drop-down menu, and select the newly added library.
The list of built-in standards are displayed in the CodeSniffer Standards table.
- Select a standard to use from the CodeSniffer Standards table, or click New to create your own standard.
-
Continue configuring the PHP_CodeSniffer preferences window as follows:
- Standard Tab Width- Select your Tab width.
- File Extensions- Specify the file extensions for files you wish to be sniffed.
- Ignore Directories and Files- To ignore directories and files you can specify patterns. Multiple patters are separated by a comma. (For example: Use "*/lib/*" to exclude all lib folders).
- Ignore Sniffs- You can specify sniffs which are to be ignored. As names, use the source attribute from the debug output (|For example: Generic.Files.LineLengthSniff).
Note:
Slash "/" can always be used as a directory separator.
|