mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-19247 Added the PHP CodeSniffer tool and lib/thirdpartylibs.xml
This commit is contained in:
parent
1905b5f68d
commit
d35df1b54a
67 changed files with 16067 additions and 0 deletions
37
phpcs
Executable file
37
phpcs
Executable 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);
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue