-
Notifications
You must be signed in to change notification settings - Fork 504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vprintf/vsprintf require a non-empty-array argument #3126
Conversation
should |
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
This pull request has been marked as ready for review. |
ecf35bc
to
c0ac13c
Compare
323ad98
to
eb1e62d
Compare
6085104
to
d14b403
Compare
} | ||
|
||
if ($placeHoldersCount instanceof IntegerRangeType | ||
&& $formatArgsCount instanceof IntegerRangeType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about handling $placeHoldersCount
as IntegerRangeType + $formarArgsCount
as ConstantIntegerType?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if I don't oversee anything, this IF statement here will cover the remaining cases.
I simplified it further.
This pull request has been marked as ready for review. |
Thank you. |
these functions throw a ValueError when called with an empty array, see