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.0.12 to 0.0.13

36

index.js
'use strict';
var q = require('q');
var shell = require('shelljs/global');
var async = require('async');
var linter = require('./lib/linter');
var cache = require('./lib/cache');
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) {

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

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

@@ -23,0 +49,0 @@

2

package.json
{
"name": "phplint",
"version": "0.0.12",
"version": "0.0.13",
"description": "wrapper for php -l",

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

@@ -23,3 +23,3 @@ 'use strict';

it('should call the then method', function (cb) {
var lint = phplint('test/pass.php');
var lint = phplint('test/pass.php', {stdout: true});
lint.then(function (msg) {

@@ -26,0 +26,0 @@ cb();

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