Skip to content

Commit c4b1349

Browse files
committed
docs: add how to update PHPStan baseline
1 parent d72a893 commit c4b1349

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

contributing/pull_request.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,28 @@ These tools have already been integrated into our CI/CD workflow to minimize una
210210
are expected that their code will pass these two. In your local machine, you can manually run these tools
211211
so that you can fix whatever errors that pop up with your submission.
212212

213+
#### PHPStan
214+
213215
PHPStan is expected to scan the entire framework by running this command in your terminal:
214216

215217
```console
216218
vendor/bin/phpstan analyse
217219
```
218220

221+
See also:
222+
- [PHPDocs Basics](https://phpstan.org/writing-php-code/phpdocs-basics)
223+
- [PHPDoc Types](https://phpstan.org/writing-php-code/phpdoc-types)
224+
225+
If PHPStan errors cannot be resolved by any means, or if the PHPStan error is
226+
false positive and should be ignored, the baseline can be updated with the following
227+
command:
228+
229+
```console
230+
vendor/bin/phpstan analyze --generate-baseline phpstan-baseline.php
231+
```
232+
233+
#### Rector
234+
219235
Rector, on the other hand, can be run on the specific files you modified or added:
220236

221237
```console

0 commit comments

Comments
 (0)