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

run php -l in parallel

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.2K
increased by4.5%
Maintainers
1
Weekly downloads
 
Created
Source

NPM

npm Build Status Dependency Status devDependency Status

node-phplint

A simple node wrapper to run php -l in parallel.

Running find . -type f -name "*.php" | xargs -n 1 php -l in a brand new Laravel project (with dependencies) took 1m 32s to find its first error. Running phplint '**/*.php' in the same project took 37s to find the same error.

CLI

$ npm install --global phplint
$ phplint '**/*.php'

node-phplint uses globby for globbing filenames, so the following would work as well:

$ phplint '**/*.php' '!vendor/**'

Node

var phplint = require('phplint').lint;

lint(['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

Grunt

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
      },
      files: 'src/**/*.php'
    }
  });

  grunt.registerTask('test', ['phplint']);

};
$ grunt test

Gulp

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
License

MIT © Wayne Ashley Berry

Keywords

FAQs

Package last updated on 18 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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