-
Notifications
You must be signed in to change notification settings - Fork 696
Closed
Description
https://psalm.dev/r/6c9dd0f8b3
Presumably caused by
psalm/src/Psalm/Internal/Provider/ReturnTypeProvider/SprintfReturnTypeProvider.php
Lines 73 to 86 in 564c6de
| // it makes no sense to use sprintf when there is only 1 arg (the format) | |
| // as it wouldn't have any placeholders | |
| if (count($call_args) === 1 && $event->getFunctionId() === 'sprintf') { | |
| IssueBuffer::maybeAdd( | |
| new TooFewArguments( | |
| 'Too few arguments for ' . $event->getFunctionId() . ', expecting at least 2 arguments', | |
| $event->getCodeLocation(), | |
| $event->getFunctionId(), | |
| ), | |
| $statements_source->getSuppressedIssues(), | |
| ); | |
| return null; | |
| } |
It states
it makes no sense to use sprintf when there is only 1 arg (the format)
as it wouldn't have any placeholders
Which sure, is true, but that's a code style issue and not statically incorrect code.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels