Problem/Motivation

Amongst the "new" errors found when running PHPStan on level 2 is: PHPDoc tag @return with type Foo is incompatible with native type void.

This child-issue exists to fix all of those.

Steps to reproduce

- Run PHPStan on level 2 and see the above error amongst all others.

Proposed resolution

- Solve all of the the above mentioned reported errors.
- Run PHPStan on level 2 and don't see the above mentioned error any more.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Spokje created an issue. See original summary.

Spokje’s picture

The attached level2.txt is the output of vendor/bin/phpstan analyze --configuration=core/phpstan.neon.dist after setting PHPStan to level 2.

We're "down" from the original [ERROR] Found 9440 errors to [ERROR] Found 9445 errors.
Hmmm, seems like the 2 commits done on the 10.1.x-branch after #3322735: [meta] Fix as many PHPStan level 2 issues as possible before bumping the rule level was created introduced some new L2 errors...

mondrake’s picture

Status: Active » Reviewed & tested by the community

Looks like a no brainer, thanks @Spokje

alexpott’s picture

Version: 10.1.x-dev » 9.4.x-dev
Status: Reviewed & tested by the community » Fixed

Backported to 9.4.x as this apples there and is correct.

Committed and pushed 81b8c86909 to 10.1.x and 74781068ec to 10.0.x and df5520b51e to 9.5.x and 28fafec11c to 9.4.x. Thanks!

  • alexpott committed 81b8c86 on 10.1.x
    Issue #3322763 by Spokje: Fix PHPStan L2 error "PHPDoc tag @return with...

  • alexpott committed 7478106 on 10.0.x
    Issue #3322763 by Spokje: Fix PHPStan L2 error "PHPDoc tag @return with...

  • alexpott committed df5520b on 9.5.x
    Issue #3322763 by Spokje: Fix PHPStan L2 error "PHPDoc tag @return with...

  • alexpott committed 28fafec on 9.4.x
    Issue #3322763 by Spokje: Fix PHPStan L2 error "PHPDoc tag @return with...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.