Skip to content

Commit

Permalink
Update readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Jun 2, 2021
1 parent 4a904d0 commit db72d22
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,21 @@
### Locally, if you have PHP

```shell
// PHP 8
$ composer require overtrue/phplint --dev -vvv

// PHP 7
$ composer require overtrue/phplint:^2.0 --dev -vvv
```

### Locally, if you only have Docker

```
docker pull overtrue/phplint:latest
// PHP 8
docker pull overtrue/phplint:8.0
// PHP 7
docker pull overtrue/phplint:7.0
```

## Usage
Expand Down Expand Up @@ -84,13 +92,11 @@ By default, the command will read configuration from file `.phplint.yml` of path

If you want to disable the config file, you can add option `--no-configuration`.

### Warnings

Not all linting problems are errors, PHP also has warnings, for example when using a `continue` statement within a
`switch` `case`. By default these errors are not reported, but you can turn this on with the `warning` cli flag, or
by setting the `warning` to true in the configuration.

### Docker cli

```bash
$ docker run overtrue/phplint ./ --exclude=vendor
```

### Program

Expand Down Expand Up @@ -125,19 +131,30 @@ $errors = $linter->lint();
### GitHub Actions

```yaml
uses: overtrue/phplint@master
uses: overtrue/phplint@8.0
with:
path: .
options: --exclude=*.log
```
for PHP 7:
```
uses: overtrue/phplint@7.4
```
### Other CI/CD (f.e. Bitbucket Pipelines, GitLab CI)
Run this command using `overtrue/phplint:latest` Docker image:
Run this command using `overtrue/phplint:8.0` Docker image:
```
/root/.composer/vendor/bin/phplint ./ --exclude=vendor
```
### Warnings
Not all linting problems are errors, PHP also has warnings, for example when using a `continue` statement within a
`switch` `case`. By default these errors are not reported, but you can turn this on with the `warning` cli flag, or
by setting the `warning` to true in the configuration.
## PHP 扩展包开发
> 想知道如何从零开始构建 PHP 扩展包?
Expand All @@ -146,7 +163,4 @@ Run this command using `overtrue/phplint:latest` Docker image:
## License
MIT
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgit.luolix.top%2Fovertrue%2Fphplint.svg?type=large)](https://app.fossa.io/projects/git%2Bgit.luolix.top%2Fovertrue%2Fphplint?ref=badge_large)
MIT

0 comments on commit db72d22

Please sign in to comment.