hypothesis / wp-hypothesis

Hypothesis WordPress plugin
https://wordpress.org/plugins/hypothesis/
Other
29 stars 14 forks source link

Add a static analysis tool like PHPStan #51

Open acelaya opened 10 months ago

acelaya commented 10 months ago

Introducing a static analysis tool would allow to have a layer similar to TypeScript's type checking.

PHPStan is a good option, but we would need to make sure it does not detect WordPress core functions as undefined.

SteelWagstaff commented 10 months ago

You might also want to look at Psalm? https://psalm.dev/. There's a WordPress plugin available (originally written by Joe Hoyle from Human Made, now maintained by the core Psalm team) that helps with making sure the tool doesn't freak out about not finding WP core functions as well: https://github.com/psalm/psalm-plugin-wordpress