Opened 8 weeks ago
Last modified 7 weeks ago
#52217 new enhancement
Fix code issues identified by PHPStan
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | |
Focuses: | coding-standards | Cc: |
Description
In #51423 several issues were identified with function argument types that were detected by PHPStan.
There are other issues that PHPStan detects too such as potentially undefined variables, functions called with incorrect number of parameters, access to undefined properties, and more as you increase the level of checking performed.
We can scan core using the level 1 checks and catch quite a few low hanging fruit, and then go from there.
Follow-up task: Consider whether it's beneficial to add PHPStan (or Psalm or Phan) analysis to the build tooling and CI.
Change History (6)
This ticket was mentioned in PR #853 on WordPress/wordpress-develop by johnbillion.
8 weeks ago
- Keywords has-patch has-unit-tests added
#3
@
8 weeks ago
Left one comment about where we put the bootstrap file, otherwise, love this idea.
Consider whether it's beneficial to add PHPStan (or Psalm or Phan) analysis to the build tooling and CI.
I lean towards yes
Trac ticket: https://core.trac.wordpress.org/ticket/52217
This introduces config for PHPStan with plenty of exclusions so we can identify real issues that need to be fixed.