Repository navigation
Conversation
- Strings::length() returns int<1, max> for a non-empty string and 0 for '' - Strings::lower(), firstLower(), upper(), firstUpper(), capitalize() and reverse() return a non-empty string for a non-empty string - Random::generate() always returns a non-empty string, as it throws for a length below 1 Co-Authored-By: Claude Code
… counts are non-negative - Strings::indexOf(), Arrays::getKeyOffset() and searchKey() return ?int<0, max> - ArrayHash::count(), ArrayList::count() and CachingIterator::getCounter() (and its $counter property) return int<0, max> Co-Authored-By: Claude Code
flatten() returns a list unless $preserveKeys is true. Co-Authored-By: Claude Code
Co-Authored-By: Claude Code
xificurk
force-pushed
the
typehints-improvements
branch
from
November 7, 2026 18:14
2dd7739 to
0c1da84
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.
These changes only touch phpDoc. Static analysis tools (PHPStan, Psalm, IDEs) now see more exact types. Runtime behaviour does not change.
Strings::length()returnsint<1, max>for a non-empty string and0for''.Strings::lower(),firstLower(),upper(),firstUpper(),capitalize()andreverse()preserve the information about a non-empty string.Random::generate()always returns a non-empty string.Strings::indexOf(),Arrays::getKeyOffset()andsearchKey()return?int<0, max>.ArrayHash::count(),ArrayList::count()andCachingIterator::getCounter()returnint<0, max>.grep()andwrap()keep the key type.flatten()returns a list unless$preserveKeysis true.isUnicode($value)returns true,$valueis astring.