Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

PHP: phpcs

LCD 47 edited this page Jun 12, 2016 · 10 revisions

This file is no longer maintained

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

Note

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
Clone this wiki locally