An open API service indexing awesome lists of open source software.

https://github.com/tengattack/phplint

A configurable linter tool for PHP.
https://github.com/tengattack/phplint

Last synced: 5 months ago
JSON representation

A configurable linter tool for PHP.

Awesome Lists containing this project

README

          

# PHPLint

A configurable linter tool for PHP.

## Introduction

### Dependencies

* [htmllint-cli](https://github.com/htmllint/htmllint-cli)
* [stylelint](https://github.com/stylelint/stylelint)
* [scss-lint](https://github.com/brigade/scss-lint) (deprecated)

### Installation

```sh
$ composer global require tengattack/phplint
$ # htmllint is used by rule `html` (it has to be latest)
$ npm i -g htmllint/htmllint-cli
$ # stylelint is used by rule `html`
$ npm i -g stylelint
$ # scss-lint is used by rule `html` (deprecated)
$ gem install scss_lint
```

### Run

```sh
$ export PATH=$PATH:~/.composer/vendor/bin
$ phplint /path/to/phpfile
```

### Configuration

If no configuration file is specified, it will first read the file `.phplint.yml` on current working directory as configuration,
and if still not exists it will use the default configuration.

You can configure it as you want base on this file: [`.phplint.yml`](./.phplint.yml).

### Example

A php file `test.php` with following content:

```php