Gulp plugin for running PHP Code Beautifier.
WARNING - This will modify your source files, ensure things are backed up!
- Install the plugin with the following command:
npm install gulp-phpcbf --save-dev
var gulp = require('gulp');
var phpcbf = require('gulp-phpcbf');
var gutil = require('gutil');
gulp.task('phpcbf', function () {
return gulp.src(['src/**/*.php', '!src/vendor/**/*.*'])
.pipe(phpcbf({
bin: 'phpcbf',
standard: 'PSR2',
warningSeverity: 0
}))
.on('error', gutil.log)
.pipe(gulp.dest('src'));
});
Inspired by gulp-phpcs.