Skip to content

Instantly share code, notes, and snippets.

@polidog
Last active February 19, 2018 12:49
Show Gist options
  • Save polidog/f83ed751fd53a089550932747b6f68db to your computer and use it in GitHub Desktop.
Save polidog/f83ed751fd53a089550932747b6f68db to your computer and use it in GitHub Desktop.
Gulp+PHP CS Fixer
var gulp = require('gulp');
var exec = require('child_process').exec;
gulp.task('watch',function(){
gulp.watch("./src/**/*.php").on('change',function(event){
var command = "php-cs-fixer fix " + event.path + " --config-file=" + __dirname + "/.php_cs"
exec(command);
console.log("execute command: "+command);
})
});
gulp.task('default',['watch']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment