New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

phplint

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phplint - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

lib/linter.js

35

index.js
'use strict';
var q = require('q');
var shell = require('shelljs/global');
var async = require('async');
var cache = require('./lib/cache');
var linter = require('./lib/linter');
var processPatterns = require('./lib/process');
var stdout = false;
var linter = function (file, cb) {
cache.has(file, function(err, isCached, hash) {
if (err) return cb(err);
if (isCached && stdout) {
return cache.get(hash, function (err, cached) {
process.stdout.write(cached.contents);
cb();
});
}
if (isCached && ! stdout) {
return cb();
}
exec('php -l '+file, {silent: ! stdout}, function (code, output) {
var err = (code === 0) ? null : output.trim();
if (err) return cb(err);
cache.put(hash, output, cb);
});
});
};
module.exports = function (patterns, options) {

@@ -44,5 +15,5 @@ var deferred = q.defer();

var limit = options.limit ? options.limit : 10;
stdout = options.stdout ? options.stdout : false;
linter.stdout = options.stdout ? options.stdout : false;
async.eachLimit(result, limit, linter, function (err) {
async.eachLimit(result, limit, linter.lint.bind(linter), function (err) {
if (err) return deferred.reject(new Error(err.trim()));

@@ -49,0 +20,0 @@

@@ -0,1 +1,3 @@

'use strict';
var _ = require('lodash');

@@ -2,0 +4,0 @@ var glob = require('glob');

{
"name": "phplint",
"version": "0.1.0",
"version": "0.1.1",
"description": "wrapper for php -l",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc