How to check PHP code for a specific set of coding rules?

I have a PHP library that I plan to send to the PEAR database. To do this, the library must follow PEAR coding standards .

Is there a tool that can check my code to make sure it is fully standards compliant?

+5
source share
2 answers

http://pear.php.net/manual/en/package.php.php-codesniffer.php

By default, PHP_CodeSniffer will use the PEAR encoding standard if no standard is specified on the command line.

+6
source

B00MER, PHP_CodeSniffer PEAR, . , , - , ( , ) , PHP_CodeSniffer, .

, :

$ phpcs -i

Zend:

$ sudo phpcs --config-set default_standard Zend

, :

$ phpcs --config-show
+1

All Articles