Skip to content

Commit 9200417

Browse files
authored
Merge pull request #8477 from kenjis/docs-pull_request-phpstan
docs: add how to update PHPStan baseline
2 parents d72a893 + 589ad86 commit 9200417

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

contributing/pull_request.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,15 @@ and the [PHPUnit website](https://phpunit.de/) for more information.
7979
Source code should be commented using PHPDoc comment blocks. This means
8080
implementation comments to explain potentially confusing sections of
8181
code, and documentation comments before each public or protected
82-
class/interface/trait, method and variable.
82+
class/interface/trait, method, and variable.
8383

8484
Do not add PHPDoc comments that are superficial, duplicated, or stating the obvious.
8585

86-
See the [phpDocumentor website](https://phpdoc.org/) for more
87-
information.
86+
See the following for more information.
87+
88+
- [PHPDoc reference](https://docs.phpdoc.org/3.0/guide/references/phpdoc/index.html#phpdoc-reference)
89+
- [PHPDocs Basics](https://phpstan.org/writing-php-code/phpdocs-basics)
90+
- [PHPDoc Types](https://phpstan.org/writing-php-code/phpdoc-types)
8891

8992
#### Code Comments
9093

@@ -210,12 +213,28 @@ These tools have already been integrated into our CI/CD workflow to minimize una
210213
are expected that their code will pass these two. In your local machine, you can manually run these tools
211214
so that you can fix whatever errors that pop up with your submission.
212215

216+
#### PHPStan
217+
213218
PHPStan is expected to scan the entire framework by running this command in your terminal:
214219

215220
```console
216221
vendor/bin/phpstan analyse
217222
```
218223

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

221240
```console

0 commit comments

Comments
 (0)