Repository navigation
Fixes to upgrade to PHPStan 2.3.1 - #1694
Merged
Merged
Conversation
Found by PHPStan 2.3
Found by PHPStan 2.3 complaining about unused `$valid_fields`
PHPStan can't see that the global `_bad_byte_sequences` is mutated by `_install_bad_sequence` and thinks it's empty unless told otherwise
The table is an associative array, not a list, and the scores are floats (because 'days since reg' is float). Found by PHPStan 2.3.
We will be able to remove this with PHPStan 2.3.2
cpeel
approved these changes
Oct 21, 2026
Comment on lines
22
to
+26
| static $was_output = false; | ||
| if ($was_output) { | ||
| return; | ||
| } | ||
| $was_output = true; |
Member
There was a problem hiding this comment.
I'm 99% confident that this function is called once and only once now that we've cleaned up the codebase a few years back. We could consider adding a deprecation warning with a traceback in the if() to alert us if it is actually triggered anywhere so we could clean it up.
Not required in this PR but an idea for later while I was reviewing it.
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.
Add some final warning fixes and upgrade to PHPStan 2.3.1.
We're staying at level 6 for the moment, but PHPStan 2.3 has significantly improved its type analysis, and has introduced a number of unused/overwritten parameter/variable warnings that are very helpful for finding dead or incomplete code.