Skip to content
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

Possible regression due sprintf: TooManyArguments #9941

Closed
ro0NL opened this issue Jun 21, 2023 · 6 comments · Fixed by #9943
Closed

Possible regression due sprintf: TooManyArguments #9941

ro0NL opened this issue Jun 21, 2023 · 6 comments · Fixed by #9943

Comments

@ro0NL
Copy link
Contributor

ro0NL commented Jun 21, 2023

After bumping global phar installation from v5 to master, including a cache removal, we see a 130 issues about sprintf in our codebase:

Too many arguments for the number of placeholders in sprintf (see https://psalm.dev/026)
$output->writeln(sprintf('Handling product %d => %d (%d)', $productId,  $categoryId, $position));
@psalm-github-bot
Copy link

Hey @ro0NL, can you reproduce the issue on https://psalm.dev ?

@ro0NL
Copy link
Contributor Author

ro0NL commented Jun 21, 2023

Sadly no

@orklah
Copy link
Collaborator

orklah commented Jun 21, 2023

Can you tell us in which PHP version you use to run Psalm (the runtime version, not the analysis version)

cc @kkmuffme

@ro0NL
Copy link
Contributor Author

ro0NL commented Jun 21, 2023

right, both php 7.4 still

@orklah
Copy link
Collaborator

orklah commented Jun 21, 2023

Note: I also reproduce on my work codebase on PHP 7.4. Seems like detection based on sprintf return is broken before PHP 8

@kkmuffme
Copy link
Contributor

@ro0NL could you test the code of #9943 to see if it fixes the issue for you?

kkmuffme added a commit to kkmuffme/psalm that referenced this issue Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants