MDL-19247 Added the PHP CodeSniffer tool and lib/thirdpartylibs.xml

This commit is contained in:
nicolasconnault 2009-05-19 15:22:43 +00:00
parent 1905b5f68d
commit d35df1b54a
67 changed files with 16067 additions and 0 deletions

37
phpcs Executable file
View file

@ -0,0 +1,37 @@
#!/usr/bin/php
<?php
/**
* PHP_CodeSniffer tokenises PHP code and detects violations of a
* defined set of coding standards.
*
* PHP version 5
*
* @category PHP
* @package PHP_CodeSniffer
* @author Greg Sherwood <gsherwood@squiz.net>
* @author Marc McIntyre <mmcintyre@squiz.net>
* @copyright 2006 Squiz Pty Ltd (ABN 77 084 670 600)
* @license http://matrix.squiz.net/developer/tools/php_cs/licence BSD Licence
* @version CVS: $Id$
* @link http://pear.php.net/package/PHP_CodeSniffer
*/
error_reporting(E_ALL | E_STRICT);
if (is_file(dirname(__FILE__).'/../CodeSniffer/CLI.php') === true) {
include_once dirname(__FILE__).'/../CodeSniffer/CLI.php';
} else {
include_once 'lib/pear/PHP/CodeSniffer/CLI.php';
}
$phpcs = new PHP_CodeSniffer_CLI();
$phpcs->checkRequirements();
$numErrors = $phpcs->process();
if ($numErrors === 0) {
exit(0);
} else {
exit(1);
}
?>