[8.x] Change whereStartsWith, DocBlock to reflect that array is supported #39370
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.
A non-breaking change to avoid IDE warnings
whereStartsWith
,whereDoesntStartWith
andthatStartWith
DocBlocks says it only accepts astring
, but anarray
also works, as it's being passed toStr::startsWith($haystack, $needles)
which accepts an array too.I also changed the variable name from
$string
to$needles
for better code readability.That could potentially be a breaking change if php8 users have started to use named properties...
Would suggest that official documentation is updated to help others save time.
User benefits:
Due to my IDE and official docs, I thought I had to do this:
When I discovered that this is supported:
Creds to @ryangjchandler who told me :)