PHPStan Setup
PHP doesn't give us that much built-in type safety. With PHPStan, we could perform static analysis to confirm:
While this probably won't be 100% ideal (especially when it comes to editor integration), it would be a HUGE step up from where we are now.
phpstan is a default plugin in phpStorm, but I never noticed closure typings or array shapes before 😬, that's neat.
Yeah, we should definitely have it setup. Perhaps I can start by going through the backend and add closure typings first.
I'll push my changes on this tonight hopefully so that we can get the list of legit errors we need to fix, and work on building stubs/fixes for any remaining ones.