Skip to content

support positional arguments in sprintf() constant format inference#1437

Merged
ondrejmirtes merged 2 commits intophpstan:1.7.xfrom
staabm:sprintf
Jun 18, 2022
Merged

support positional arguments in sprintf() constant format inference#1437
ondrejmirtes merged 2 commits intophpstan:1.7.xfrom
staabm:sprintf

Conversation

@staabm
Copy link
Copy Markdown
Contributor

@staabm staabm commented Jun 17, 2022

re-submit of a previous PR which had to be backed out because of php warnings, see #1426 (comment)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this array-key-exists check now prevents the warning we saw earlier:

Warning: Undefined array key 1 in /Users/ondrej/Development/phpstan/src/Type/Php/SprintfFunctionDynamicReturnTypeExtension.php on line 49
PHP Warning:  Undefined array key 1 in /Users/ondrej/Development/phpstan/src/Type/Php/SprintfFunctionDynamicReturnTypeExtension.php on line 49

@staabm staabm marked this pull request as ready for review June 17, 2022 16:41
@ondrejmirtes ondrejmirtes merged commit 8801edb into phpstan:1.7.x Jun 18, 2022
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you.

@staabm staabm deleted the sprintf branch June 18, 2022 06:23
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 this pull request may close these issues.

2 participants