Configuration Options

Configuration Options -- A list of configuration options

PHP_CodeSniffer Configuration Options

Setting the Default Coding Standard

By default, PHP_CodeSniffer will use the PEAR coding standard if no standard is supplied on the command line. You can change the default standard by setting the default_standard configuration option.

Setting the Default Report Format

By default, PHP_CodeSniffer will use the full report format if no format is supplied on the command line. You can change the default report format by setting the report_format configuration option.

Hiding Warnings by Default

By default, PHP_CodeSniffer will show both errors and warnings for your code. You can hide warnings for a single script run by using the -n command line argument, but you can also enable this by default if you prefer. To hide warnings by default, set the show_warnings configuration option to 0.

Note: When warnings are hidden by default, you can use the -w command line argument to show them for a single script run.

Setting the Default Tab Width

By default, PHP_CodeSniffer will not convert tabs to spaces in checked files. Specifying a tab width will make PHP_CodeSniffer replace tabs with spaces. You can force PHP_CodeSniffer to replace tabs with spaces by default by setting the tab_width configuration option.

Note: When the tab width is set by default, the replacement of tabs with spaces can be disabled for a single script run by setting the tab width to zero.

Zend Coding Standard Configuration Options

Setting the Path to the Zend Code Analyzer

The Zend coding standard includes a sniff that will check each file using the Zend Code Analyzer, a tool that comes with Zend Studio. Use the zend_ca_path configuration option to tell the Zend Code Analyzer sniff where to find the tool.