From c4b1349b6ed1266ec0302c1567c005e7ad85c15d Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 29 Jan 2024 16:27:16 +0900 Subject: [PATCH 1/3] docs: add how to update PHPStan baseline --- contributing/pull_request.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/contributing/pull_request.md b/contributing/pull_request.md index 0a863fd39746..c2b71ecf54c9 100644 --- a/contributing/pull_request.md +++ b/contributing/pull_request.md @@ -210,12 +210,28 @@ These tools have already been integrated into our CI/CD workflow to minimize una are expected that their code will pass these two. In your local machine, you can manually run these tools so that you can fix whatever errors that pop up with your submission. +#### PHPStan + PHPStan is expected to scan the entire framework by running this command in your terminal: ```console vendor/bin/phpstan analyse ``` +See also: +- [PHPDocs Basics](https://phpstan.org/writing-php-code/phpdocs-basics) +- [PHPDoc Types](https://phpstan.org/writing-php-code/phpdoc-types) + +If PHPStan errors cannot be resolved by any means, or if the PHPStan error is +false positive and should be ignored, the baseline can be updated with the following +command: + +```console +vendor/bin/phpstan analyze --generate-baseline phpstan-baseline.php +``` + +#### Rector + Rector, on the other hand, can be run on the specific files you modified or added: ```console From c26775ba6ed0c4c6a0ab6b6e2bd0c48fb55cd399 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 29 Jan 2024 16:27:36 +0900 Subject: [PATCH 2/3] docs: add `,` --- contributing/pull_request.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributing/pull_request.md b/contributing/pull_request.md index c2b71ecf54c9..8723bcc5479d 100644 --- a/contributing/pull_request.md +++ b/contributing/pull_request.md @@ -79,7 +79,7 @@ and the [PHPUnit website](https://phpunit.de/) for more information. Source code should be commented using PHPDoc comment blocks. This means implementation comments to explain potentially confusing sections of code, and documentation comments before each public or protected -class/interface/trait, method and variable. +class/interface/trait, method, and variable. Do not add PHPDoc comments that are superficial, duplicated, or stating the obvious. From 589ad8687465e0bc3c741292083d661e68477aa0 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 29 Jan 2024 16:27:54 +0900 Subject: [PATCH 3/3] docs: add PHPDoc references --- contributing/pull_request.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contributing/pull_request.md b/contributing/pull_request.md index 8723bcc5479d..f0950a408283 100644 --- a/contributing/pull_request.md +++ b/contributing/pull_request.md @@ -83,8 +83,11 @@ class/interface/trait, method, and variable. Do not add PHPDoc comments that are superficial, duplicated, or stating the obvious. -See the [phpDocumentor website](https://phpdoc.org/) for more -information. +See the following for more information. + +- [PHPDoc reference](https://docs.phpdoc.org/3.0/guide/references/phpdoc/index.html#phpdoc-reference) +- [PHPDocs Basics](https://phpstan.org/writing-php-code/phpdocs-basics) +- [PHPDoc Types](https://phpstan.org/writing-php-code/phpdoc-types) #### Code Comments