mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
37 lines
915 B
PHP
Executable file
37 lines
915 B
PHP
Executable file
#!/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);
|
|
}
|
|
|
|
?>
|