Skip to content

[PIWOO-714] Introduce phpstan#1183

Open
Biont wants to merge 14 commits intodev/developfrom
dev/PIWOO-714-introduce-phpstan
Open

[PIWOO-714] Introduce phpstan#1183
Biont wants to merge 14 commits intodev/developfrom
dev/PIWOO-714-introduce-phpstan

Conversation

@Biont
Copy link
Copy Markdown
Collaborator

@Biont Biont commented Mar 31, 2026

The problem

Currently, there are many psalm exclusion rules, making the results of static PHP analysis questionable.

PHP Static Analysis

As of 2025, PHP static analysis is done using PHPStan. For legacy projects, strive for compliance with level 5, if possible 7. More modern projects should pass level 8.

Current status:

Level 5 migration is finished and passing tests

Biont added 2 commits April 2, 2026 15:15
…at-level-5

[PIWOO-714] Fix PHPStan warnings at level 5
- Resolved conflict in services.php: took upstream refactor of PayPalExpressButton factory (uses actual WC gateway instance, throws on missing gateway)
- Fixed PHPStan: remove unreachable return after wp_send_json_error() in PayPalAjaxRequests
- Fixed PHPStan: assert WC_Product_Variable before calling get_available_variations() in PayPalExpressButton::isVirtualProduct()
@Biont Biont marked this pull request as ready for review April 17, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant