vprintf/vsprintf require a non-empty-array argument#3126
Merged
ondrejmirtes merged 14 commits intophpstan:1.11.xfrom Jul 19, 2024
Merged
vprintf/vsprintf require a non-empty-array argument#3126ondrejmirtes merged 14 commits intophpstan:1.11.xfrom
ondrejmirtes merged 14 commits intophpstan:1.11.xfrom
Conversation
Contributor
Author
|
should |
Member
|
Your example is misleading: https://3v4l.org/Mvl72 It'd make much more sense to create a rule similar to PrintfParametersRule. |
08e8aa1 to
faf6099
Compare
staabm
commented
Jun 4, 2024
staabm
commented
Jun 5, 2024
ondrejmirtes
requested changes
Jun 5, 2024
Member
ondrejmirtes
left a comment
There was a problem hiding this comment.
I don't see tests for general arrays
- Zero placeholders + array (it's okay)
- One or more placeholders + array (not okay)
- One or more placeholders + non-empty-array (okay)
Collaborator
|
This pull request has been marked as ready for review. |
ecf35bc to
c0ac13c
Compare
323ad98 to
eb1e62d
Compare
This was referenced Jun 19, 2024
6085104 to
d14b403
Compare
ondrejmirtes
requested changes
Jul 15, 2024
ondrejmirtes
requested changes
Jul 17, 2024
Member
There was a problem hiding this comment.
What about handling $placeHoldersCount as IntegerRangeType + $formarArgsCount as ConstantIntegerType?
Contributor
Author
There was a problem hiding this comment.
if I don't oversee anything, this IF statement here will cover the remaining cases.
I simplified it further.
Collaborator
|
This pull request has been marked as ready for review. |
Member
|
Thank you. |
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 functions throw a ValueError when called with an empty array, see