This repository has been archived by the owner on Sep 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
(v3.5.0) PHP: phpcs
LCD 47 edited this page Dec 13, 2014
·
1 revision
Maintainer: Martin Grenfell [email protected]
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