在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):wayneashleyberry/phplint开源软件地址(OpenSource Url):https://github.com/wayneashleyberry/phplint开源编程语言(OpenSource Language):JavaScript 99.3%开源软件介绍(OpenSource Introduction):phplint
UsageCLI$ npm i -g phplint
$ phplint '**/*.php' Paths and filenames are parsed using globby, so the following would work as well: $ phplint '**/*.php' '!vendor/**' Nodevar phplint = require("phplint").lint;
phplint(["src/**/*.php"], function (err, stdout, stderr) {
if (err) throw new Error(err);
process.stdout.write(stdout);
process.stderr.write(stderr);
// success!
}); NPM{
"scripts": {
"pretest": "phplint 'src/**/*.php'"
},
"devDependencies": {
"phplint": "~1.0.0"
}
} $ npm test GruntConfigure cache directoriesThis module uses the module.exports = function (grunt) {
require("phplint").gruntPlugin(grunt);
grunt.initConfig({
phplint: {
options: {
limit: 10,
phpCmd: "/home/scripts/php", // Defaults to php
stdout: true,
stderr: true,
useCache: true, // Defaults to false
tmpDir: "/custom/root/folder", // Defaults to os.tmpDir()
cacheDirName: "custom/subfolder", // Defaults to php-lint
},
files: "src/**/*.php",
},
});
grunt.registerTask("test", ["phplint"]);
}; $ grunt test GulpThe same options that can be used in Grunt can be used in Gulp too. 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 RelatedLicense |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论