phpstan-src icon indicating copy to clipboard operation
phpstan-src copied to clipboard

vprintf/vsprintf require a non-empty-array argument

Open staabm opened this issue 1 year ago • 3 comments

these functions throw a ValueError when called with an empty array, see

  • https://3v4l.org/5Ro2C
  • https://3v4l.org/E7Tev

staabm avatar Jun 04 '24 15:06 staabm

should SprintfFunctionDynamicReturnTypeExtension return a ErrorType in these cases?

staabm avatar Jun 04 '24 15:06 staabm

Your example is misleading: https://3v4l.org/Mvl72

It'd make much more sense to create a rule similar to PrintfParametersRule.

ondrejmirtes avatar Jun 04 '24 15:06 ondrejmirtes

This pull request has been marked as ready for review.

phpstan-bot avatar Jun 05 '24 09:06 phpstan-bot

This pull request has been marked as ready for review.

phpstan-bot avatar Jul 17 '24 15:07 phpstan-bot

Thank you.

ondrejmirtes avatar Jul 19 '24 11:07 ondrejmirtes