class SyntaxChecker extends Maintenance {
// List of files we're going to check
- private $mFiles = array();
+ private $mFiles, $mFailures = array();
public function __construct() {
parent::__construct();
* Check the files for syntax errors
*/
private function checkSyntax() {
- $count = $bad = 0;
foreach( $this->mFiles as $f ) {
- $count++;
$res = exec( 'php -l ' . $f );
if( strpos( $res, 'No syntax errors detected' ) === false ) {
- $bad++;
+ $this->mFailures[] = $f;
$this->error( $res . "\n" );
}
}
- $this->output( "$count files checked, $bad failures\n" );
+ $this->output( count($this->mFiles) . " files checked, "
+ . count($this->mFailures) . " failures\n" );
}
}