Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 315dd93

Browse files
authored
Merge pull request #43 from mavimo/feature/TECH-improve-docs
refs #TECH: update docs and prepare for release 0.3.0
2 parents 58d797f + e2f46dc commit 315dd93

File tree

1 file changed

+36
-22
lines changed

1 file changed

+36
-22
lines changed

README.md

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,66 +2,80 @@
22

33
[![License](https://img.shields.io/packagist/l/mavimo/phpstan-junit.svg)](http://opensource.org/licenses/MIT)
44
[![Coverage Status](https://img.shields.io/codecov/c/github/mavimo/phpstan-junit/master.svg)](https://codecov.io/gh/mavimo/phpstan-junit?branch=master)
5+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/ce52632640e74313b03862890e9990fc)](https://www.codacy.com/manual/mavimo/phpstan-junit)
56

67
[![Packagist](http://img.shields.io/packagist/v/mavimo/phpstan-junit.svg)](https://packagist.org/packages/mavimo/phpstan-junit)
78
[![Packagist](http://img.shields.io/packagist/dt/mavimo/phpstan-junit.svg)](https://packagist.org/packages/mavimo/phpstan-junit)
89
[![Packagist](http://img.shields.io/packagist/dm/mavimo/phpstan-junit.svg)](https://packagist.org/packages/mavimo/phpstan-junit)
910
[![Packagist](http://img.shields.io/packagist/dd/mavimo/phpstan-junit.svg)](https://packagist.org/packages/mavimo/phpstan-junit)
1011

11-
The main scope for this project is to create error report in **JUnit** format that can be easly integrated in *Jenkins* or other tools that use this information.
12+
The main scope for this project is to create error report in **JUnit** format that can be easly integrated in _Jenkins_ or other tools that use this information.
1213

1314
## How to use it
1415

1516
### Install
1617

17-
You need to include this library in your project as dev-dependency, it dependes on the version of phpstan you're using you should use a different version of `mavimo/phpstan-junit` library.
18+
You need to include this library in your project as dev-dependency, it dependes on the version of phpstan you're using you should use a different version of `mavimo/phpstan-junit` library, this table will give you a dependency map:
1819

19-
#### PHPStan 0.10
20+
| `phpstan/phpstan` version | `mavimo/phpstan-junit` version |
21+
| ------------------------- | ------------------------------ |
22+
| `0.10.x` | `0.1.x` |
23+
| `0.11.x` | `0.2.x` |
24+
| `0.12.x` | `0.3.x` |
25+
26+
But if alredy specified the `phpstan/phpstan` version you can just use:
2027

21-
You need to require the version `0.1.0` of this package:
2228
```bash
23-
composer require --dev mavimo/phpstan-junit:~0.1.0
29+
composer require --dev mavimo/phpstan-junit
2430
```
2531

26-
You should require this extension on `phpstan.neon` file in the root of your project or the file you specify to phpstan using the `--config` flag by referencing `extension.neon` file:
32+
If you also install [phpstan/extension-installer](https://github.com/phpstan/extension-installer) then you're all set, otherwise take a look to _manual setup_ section below.
33+
34+
<details>
35+
<summary><strong>Manual setup for PHPStan 0.11 and next</strong></summary>
36+
if you don't want to use `phpstan/extension-installer`, you should require the `extension.neon` file on your `phpstan.neon.dist` file in the root of your project (or on the file you specify to phpstan using the `--config` flag):
2737

2838
```yaml
2939
includes:
30-
- vendor/mavimo/phpstan-junit/phpstan.neon
40+
- vendor/mavimo/phpstan-junit/extension.neon
3141
```
32-
or declaring the service via:
42+
43+
or declaring the service via:
44+
3345
```yaml
3446
services:
3547
errorFormatter.junit:
3648
class: Mavimo\PHPStan\ErrorFormatter\JunitErrorFormatter
3749
```
3850
39-
#### PHPStan 0.11
40-
41-
The current version is not marked as stable (should be in some week), so you need to pull the version from master:
42-
```bash
43-
composer require --dev mavimo/phpstan-junit:~0.2.0
44-
```
51+
</details>
4552
46-
If you also install [phpstan/extension-installer](https://github.com/phpstan/extension-installer) then you're all set; if you don't want to use `phpstan/extension-installer`, you should require the `extension.neon` file on your `phpstan.neon.dist` file in the root of your project (or on the file you specify to phpstan using the `--config` flag):
53+
<details>
54+
<summary><strong>Manual setup for PHPStan 0.10</strong></summary>
55+
<br />
56+
You should require this extension on `phpstan.neon` file in the root of your project or the file you specify to phpstan using the `--config` flag by referencing `extension.neon` file:
4757

4858
```yaml
4959
includes:
50-
- vendor/mavimo/phpstan-junit/extension.neon
60+
- vendor/mavimo/phpstan-junit/phpstan.neon
5161
```
52-
or declaring the service via:
62+
63+
or declaring the service via:
64+
5365
```yaml
5466
services:
5567
errorFormatter.junit:
5668
class: Mavimo\PHPStan\ErrorFormatter\JunitErrorFormatter
5769
```
5870

71+
</details>
72+
5973
### Generate JUnit report
6074

6175
You should gnerate JUnit report with the flag `--error-format=junit`, eg:
6276

6377
```bash
64-
vendor/bin/phpstan --configuration=phpstan.neon --error-format=junit --level=7 --no-progress --no-interaction analyse SOURCE_CODE_DIR
78+
vendor/bin/phpstan --error-format=junit --no-progress --no-interaction analyse src
6579
```
6680

6781
## Contributing
@@ -70,9 +84,9 @@ Contributions are welcome!
7084

7185
PR's will be merged only if:
7286

73-
- *phpunit* is :white_check_mark:, you can run it using `vendor/bin/phpunit`
74-
- *phpstan* is :white_check_mark:, you can run it using `vendor/bin/phpstan analyse`
75-
- *phpcs* is :white_check_mark:, you can run it using `vendor/bin/phpcs`
76-
- *code coverage* will not decrease (or there are good reason to decrease it), you can check the current coverage using `phpdbg -qrr ./vendor/bin/phpunit --coverage-text`
87+
- _phpunit_ is :white_check_mark:, you can run it using `vendor/bin/phpunit`
88+
- _phpstan_ is :white_check_mark:, you can run it using `vendor/bin/phpstan analyse`
89+
- _phpcs_ is :white_check_mark:, you can run it using `vendor/bin/phpcs`
90+
- _code coverage_ will not decrease (or there are good reason to decrease it), you can check the current coverage using `phpdbg -qrr ./vendor/bin/phpunit --coverage-text`
7791

7892
If you have any question feel free to open a issue or contact me!

0 commit comments

Comments
 (0)