How to setup PHP_CodeSniffer on OS X under XAMPP

PHP_CodeSniffer is a PHP5 script that tokenises and "sniffs" PHP, JavaScript and CSS files to detect violations of a defined coding standard.

install PHP_CodeSniffer 

$ sudo /Applications/XAMPP/xamppfiles/bin/pear install PHP_CodeSniffer 
 

copy CodeSniffer to correct path

$ cp -R /Applications/XAMPP/xamppfiles/PHP/CodeSniffer /Applications/XAMPP/xamppfiles/ 
 

create Symbolic Link 

$ ln -s /Applications/XAMPP/xamppfiles/bin/phpcs phpcs 
 

usage 

$ ./phpcs -n /path/to/your/file.php 

Post new comment

© 2010 Pangpond.. Theme by Kiwi Themes.