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
Too few arguments in SprintfFunctionDynamicReturnTypeExtension #2342
Comments
This bug report is missing a link to reproduction on phpstan.org. |
Yes, this is a bug, thanks. Also, the wrong |
I tried reproducing the reported warning on php 7.4 (since phpstan no longer 7.1 which is the one the OP used). I cannot test on 7.2 with my setup. regarding the argument count problem I created a fix in phpstan/phpstan-src#2041 |
@ondrejmirtes After the latest push in 1.10.x, PHPStan now reports different result with your code snippet: @@ @@
-No errors
+3: Call to sprintf contains 1 placeholder, 0 values given. Full report
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
When analyzing code like this:
$sql = sprintf('UPDATE {{%loans}} SET field=1');
i get
Warning: sprintf(): Too few arguments in /var/www/html/vendor/phpstan/phpstan/src/Type/Php/SprintfFunctionDynamicReturnTypeExtension.php on line 39
in console during progress run
/var/www/html # vendor/bin/phpstan analyze --memory-limit=2G -c phpstan.neon
Code snippet that reproduces the problem
$sql = sprintf('UPDATE {{%loans}} SET field=1');
Expected output
without warnings
The text was updated successfully, but these errors were encountered: