-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PHP: phpcs
This file exists only as a historic reference. Documentation for syntastic
checkers is now included in the manual, please see :help syntastic-checkers
in Vim.
Maintainer: Martin Grenfell martin.grenfell@gmail.com
PHP_CodeSniffer is a style checker for PHP and CSS. See the project's page at GitHub for details.
Install it with:
pear install PHP_CodeSniffer
If you're checking files containing tab characters then PHP_CodeSniffer's
idea of tabstop must match Vim's tabstop
, otherwise syntastic will highlight
the errors at shifted positions. By default syntastic does that by adding
an option --tab-width=&tabstop
to PHP_CodeSniffer, but that option
also instructs PHP_CodeSniffer to expand tabs, and some code sniffers
(f.i. CakePHP1) insist on indenting lines with tabs. To work around the
resulting mess if you're using one of these sniffers, set --tab-width=0
and
&tabstop
to 8:
let g:syntastic_php_phpcs_args='--tab-width=0'
set tabstop=8