Skip to content

PHP_CodeSniffer Configuration

Sven Kiera edited this page Jul 5, 2015 · 3 revisions

WikiToolsPHP_CodeSnifferConfiguration

Configuration

To configure PHP CodeSniffer follow these steps:

1. From the menu bar select Window -> Preferences

![]

2. From the tree view of Preferences page select PHP Tools -> PHP CodeSniffer. On this page you can configure PHP CodeSniffer.

![][1]

3. First select a PHP Executable for running PHP CodeSniffer.

![][2]

4. You can choose to use your own PEAR library or the internal. Note that the internal library is always within the include path so missing packages are used from there.

![][3]

5. If you wish to print PHP output to console for debugging activate the checkbox.

![][4]

6. Select one or more included CodeSniffer Standard as Default or add an own. To add a custom standard push New… and provide a Name and a Path to it.

![][5]

7. Select your Tab width.

![][6]

8. To ignore directories and files you can specifies patterns. Multiple patters are separated by a comma. For example to exclude all lib folders you can use “/lib/”. Note that you can always use a slash “/” as directory separator.

![][7]

9. Last you can specify sniffs which will be ignored. As name use the source attribute from debug output (for example Generic.Files.LineLengthSniff).

![][8]

[]: window_preferences.gif [1]: php_codesniffer_preferences.gif [2]: preferences_pti_tools_php_executable.gif [3]: preferences_pti_tools_pear_library.gif [4]: preferences_pti_tools_debug.gif [5]: preferences_codesniffer_standards.gif [6]: preferences_codesniffer_standard_tab_width.gif [7]: preferences_codesniffer_ignore_directories_and_files.gif [8]: preferences_codesniffer_ignore_sniffs.gif