[12.x] fix invalid array doctypes for Str::replaceMatches in v12.47.0#58364
Merged
taylorotwell merged 2 commits intoJan 15, 2026
Merged
[12.x] fix invalid array doctypes for Str::replaceMatches in v12.47.0#58364taylorotwell merged 2 commits into
taylorotwell merged 2 commits into
Conversation
This was referenced Jan 13, 2026
Contributor
|
Thanks for recognizing and fixing it this quick! 👍🏻 |
shaedrich
added a commit
to shaedrich/framework
that referenced
this pull request
Jan 15, 2026
taylorotwell
pushed a commit
that referenced
this pull request
Jan 15, 2026
* Add type tests for `\Illuminate\Support\Str` * Add missing parameter to startsWith * Use short form of type * Remove non-existing case * Fix type * Fix typo * Narrow type * Negate typesy * Inverse expectation * Use expected notation * Same here * Fix casing tests * Fix `Str::position()` test case * Fix remaining casing test cases * Adjust `Str::replaceMatches()` to #58364 * Fix empty string type and narrow non-empty-string case-sensitive types * Reorder types to assert
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.
With release 12.47.0 the
Str::replaceMatches()method does not accept simple strings as the subject anymore (checked by PHPStan) and pretends to return a nullable array with a simple string subject whereas it should return a nullable string instead and only a nullable array if the subject is an array as well.This PR fixes the doc types accordingly.