Repository navigation
feat: Add PHPStan and fix static analysis issues - #10
Merged
Merged
Conversation
craig410
approved these changes
Nov 4, 2026
There is currently no way to tell phpstan how to type a callable that accepts any set of arguments, in the pattern that we previously used. Rather than trying to jump through hoops to support this, it is both cleaner and safer to have FactoryFunction take a plain callable with no args. If there's a user-supplied callable that needs args, it can be wrapped in another callable closer to the original scope - this means that phpstan will be able to analyse it, and runtime TypeError etc will appear nearer to the place where the actual problem arises.
Basically only adds declare strict types where possible.
Adds method return types where these are fully known.
Including to the error handler function.
acoulton
force-pushed
the
feat-phpstan
branch
from
November 4, 2026 16:27
b503f1c to
8286d9c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.