|
6 | 6 |
|
7 | 7 | ---
|
8 | 8 |
|
9 |
| -This repository (`phpstan/phpstan-src`) is for PHPStan's development only. Head to [`phpstan/phpstan`](https://github.com/phpstan/phpstan) for the main README, or to [create an issue](https://github.com/phpstan/phpstan/issues/new/choose). |
10 |
| - |
11 |
| -## Code of Conduct |
12 |
| - |
13 |
| -This project adheres to a [Contributor Code of Conduct](https://github.com/phpstan/phpstan/blob/master/CODE_OF_CONDUCT.md). |
14 |
| -By participating in this project and its community, you are expected to uphold this code. |
| 9 | +This repository (`phpstan/phpstan-src`) is for PHPStan's development only. Head to [`phpstan/phpstan`](https://github.com/phpstan/phpstan) for the main README, or to [create an issue](https://github.com/phpstan/phpstan/issues/new/choose). |
15 | 10 |
|
16 | 11 | ## Contributing
|
17 | 12 |
|
18 | 13 | Any contributions are welcome.
|
19 | 14 |
|
20 | 15 | ### Building
|
21 | 16 |
|
22 |
| -Initially you need to run `composer install`, or `composer update` in case you aren't working in a folder which was built before. |
| 17 | +Initially you need to run `composer install`, or `composer update` in case you aren't working in a directory which was built before. |
23 | 18 |
|
24 | 19 | Afterwards you can either run the whole build including linting and coding standards using
|
25 | 20 |
|
26 | 21 | ```bash
|
27 | 22 | vendor/bin/phing
|
28 | 23 | ```
|
29 | 24 |
|
30 |
| -or run only tests using |
| 25 | +### Running development version |
| 26 | + |
| 27 | +You can also choose to run only part of the build. To analyse PHPStan by PHPStan itself, run: |
| 28 | + |
| 29 | +```bash |
| 30 | +vendor/bin/phing phpstan |
| 31 | +``` |
| 32 | + |
| 33 | +### Fixing code style |
| 34 | + |
| 35 | +To detect code style issues, run: |
31 | 36 |
|
| 37 | +```bash |
| 38 | +vendor/bin/phing cs |
| 39 | +``` |
| 40 | + |
| 41 | +This requires PHP 7.4. On older versions the build target will be skipped and succeed silently. |
| 42 | + |
| 43 | +And then to fix code style, run: |
| 44 | + |
| 45 | +```bash |
| 46 | +vendor/bin/phing cs-fix |
| 47 | +``` |
| 48 | + |
| 49 | +### Running tests |
| 50 | + |
| 51 | +Run: |
32 | 52 | ```bash
|
33 | 53 | vendor/bin/phing tests
|
34 | 54 | ```
|
| 55 | + |
| 56 | +### Debugging |
| 57 | + |
| 58 | +1. Make sure XDebug is installed and configured. |
| 59 | +2. Add `--xdebug` option when running PHPStan. Without it PHPStan turns the debugger off at runtime. |
| 60 | + |
| 61 | +## Code of Conduct |
| 62 | + |
| 63 | +This project adheres to a [Contributor Code of Conduct](https://github.com/phpstan/phpstan/blob/master/CODE_OF_CONDUCT.md). |
| 64 | +By participating in this project and its community, you are expected to uphold this code. |
0 commit comments