

CLI
$ npm install --global phplint
$ phplint **/*.php
Node
var phplint = require('phplint').lint;
lint(['src/**/*.php'], function (err, stdout, stderr) {
if (err) throw new Error(err);
process.stdout.write(stdout);
process.stderr.write(stderr);
});
NPM
{
"scripts": {
"pretest": "phplint 'src/**/*.php'"
},
"devDependencies": {
"phplint": "~1.0.0"
}
}
$ npm test
Grunt
module.exports = function(grunt) {
require('phplint').gruntPlugin(grunt);
grunt.initConfig({
phplint: {
options: {
limit: 10,
stdout: true,
stderr: true
},
files: 'src/**/*.php'
}
});
grunt.registerTask('test', ['phplint']);
};
$ grunt test
Gulp
var gulp = require('gulp');
var phplint = require('phplint').lint;
gulp.task('phplint', function(cb) {
phplint(['src/**/*.php'], {limit: 10}, function (err, stdout, stderr) {
if (err) {
cb(err);
process.exit(1);
}
cb();
});
});
gulp.task('test', ['phplint']);
$ gulp test
License
MIT © Wayne Ashley Berry