# gulp-phplint

> PHPLint plugin for Gulp

Latest version **0.9.0** (published 2018-08-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-phplint
pnpm add gulp-phplint
yarn add gulp-phplint
bun add gulp-phplint
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.0 |
| Published | 2018-08-06 |
| First published | 2015-12-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.12.0 |
| Dependencies | 9 |
| Unpacked size | 23.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Mike Erickson |
| Maintainers | codedungeon |
| Keywords | gulpplugin, phplint, php, gulp |

## Links

- npm: https://www.npmjs.com/package/gulp-phplint
- Repository: https://github.com/mikeerickson/gulp-phplint
- Homepage: https://github.com/mikeerickson/gulp-phplint#readme
- Issues: https://github.com/mikeerickson/gulp-phplint/issues
- npm.io page: https://npm.io/package/gulp-phplint

## Dependencies (9)

- [chalk](https://npm.io/package/chalk.md) ^2.4.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.10
- [through2](https://npm.io/package/through2.md) ^2.0.3
- [exit-code](https://npm.io/package/exit-code.md) ^1.0.2
- [fancy-log](https://npm.io/package/fancy-log.md) ^1.3.2
- [map-stream](https://npm.io/package/map-stream.md) ^0.0.7
- [gulp-notify](https://npm.io/package/gulp-notify.md) ^3.2.0
- [plugin-error](https://npm.io/package/plugin-error.md) ^1.0.1
- [escape-string-regexp](https://npm.io/package/escape-string-regexp.md) ^1.0.5

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 0.9.0 (latest) — 2018-08-06
- 0.8.0 — 2018-06-05
- 0.7.1 — 2018-06-04
- 0.5.1 — 2018-03-12
- 0.5.0 — 2018-03-12
- 0.4.1 — 2018-01-10
- 0.3.4 — 2017-01-21
- 0.3.2 — 2016-09-29
- 0.3.1 — 2016-09-10
- 0.3.0 — 2016-09-01
- 0.2.3 — 2016-09-01
- 0.2.2 — 2016-09-01
- 0.2.1 — 2016-09-01
- 0.2.0 — 2016-09-01
- 0.1.0 — 2016-03-20
- … 6 more at https://npm.io/package/gulp-phplint/versions

## README

# gulp-phplint
PHPLint plugin for Gulp

## Installation

Install `phplint` service (globally)

```shell
npm i -g phplint
```
```shell
yarn global add phplint
```

Install `gulp-phplint` as a development dependency to your project (for each project)

```shell
npm i -S gulp-phplint
```
```shell
yarn add gulp-phplint -D
```


## Usage

After you have installed the plugin, reference it in to your `gulpfile.js`:

```javascript
var phplint = require('gulp-phplint');
```

### Option 1

Default format. Equivalent to using `phplint` in command line (no options).

```javascript
var gulp    = require('gulp');
var phplint = require('gulp-phplint');

gulp.task('phplint', function() {
  gulp.src('')
    .pipe(phplint());
});
```

### Option 2

Default format using the `error` reporter.

``` javascript
gulp.task('phplint', function() {
  return gulp.src(['./src/AppBundle/**/*.php'])
    .pipe(phplint('', { /*opts*/ }))
    .pipe(phplint.reporter('error'));
});
```

### Option 3

Custom src files and custom reporter.

``` javascript
gulp.task('phplint:custom', function () {
  return gulp.src(['./src/AppBundle/**/*.php'])
    .pipe(phplint('', { /*opts*/ }))
    .pipe(phplint.reporter(function(file){
      var report = file.phplintReport || {};
      if (report.error) {
        console.error(report.message+' on line '+report.line+' of '+report.filename);
      }
    }));
});
```


## API

### phplint(path, options)

#### path

Type: `String`

Path to `php` binary.
If not supplied, the default php path will be used.

#### options.debug
Type:    `Boolean`
Default: `false`

Enable debug mode (enables --debug switch as well).

#### options.clear
Type:    `Boolean`
Default: `false`

Clear console before executing command.

#### options.dryRun
Type:    `Boolean`
Default: `false`

Simulates script execution. Doesn't actually execute tests, just echoes command that would be executed.

#### options.notify
Type:    `Boolean`
Default: `true`

Conditionally display notification (both console and growl where applicable).

#### options.statusLine
Type:    `Boolean`
Default: `true`

Displays status lines as follows:

  - green for passing files
  - red for failing files
  - yellow for an execution which has `debug` property enabled (will also display red and green statuses)

#### skipPassedFiles
Type:    `Boolean`
Default: `false`

Suppress reporting files which don't have syntax errors (files that passed linting).


## Credits

gulp-phplint written by Mike Erickson

E-Mail: [codedungeon@gmail.com](mailto:codedungeon@gmail.com)

Twitter: [@codedungeon](http://twitter.com/codedungeon)

Website: [codedungeon.org](http://codedungeon.org)

Inspired By: [jamarzka/gulp-phplint](https://github.com/jamarzka/gulp-phplint)

---
_Source: https://npm.io/package/gulp-phplint · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
