Skip to content

Too few arguments in SprintfFunctionDynamicReturnTypeExtension #2342

@stepanets

Description

@stepanets

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


Warning: sprintf(): Too few arguments in /var/www/html/vendor/phpstan/phpstan/src/Type/Php/SprintfFunctionDynamicReturnTypeExtension.php on line 39
 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

изображение

Code snippet that reproduces the problem

$sql = sprintf('UPDATE {{%loans}} SET field=1');

PHPStan - PHP Static Analysis Tool 0.11.12

parameters:
    level: max
    reportMagicProperties: false
    autoload_files:
        - %rootDir%/../../yiisoft/yii2/Yii.php

PHP 7.1.30 (cli) (built: Jun 18 2019 00:54:58) ( NTS )

Expected output

without warnings

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions