wp-hypothesis icon indicating copy to clipboard operation
wp-hypothesis copied to clipboard

Add a static analysis tool like PHPStan

Open acelaya opened this issue 1 year ago • 1 comments

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.

acelaya avatar Jan 25 '24 14:01 acelaya

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

SteelWagstaff avatar Jan 25 '24 20:01 SteelWagstaff