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

added SscanfFunctionDynamicReturnTypeExtension return type extension #1434

Merged
merged 4 commits into from Jun 17, 2022

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Jun 17, 2022

No description provided.

@staabm staabm marked this pull request as ready for review June 17, 2022 13:54
assertType('int|null', sscanf('20-20', '%d-%d', $first, $second));
assertType('array{int, int}|null', sscanf('20-20', '%d-%d'));

assertType('array{string}|null', sscanf($s, '%c'));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines 8 to 9
assertType('int|null', sscanf($s, $s, $first, $second));
assertType('array|null', sscanf($s, $s));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the 2 test-cases which existed before.. now with just a string format, because otherwise we would not get the same results

Copy link
Member

Choose a reason for hiding this comment

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

Please change assertions of the existing sscanf('20-20', '%d-%d', $first, $second) test and add sscanf($s, $s, $first, $second) as a separate one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@staabm
Copy link
Contributor Author

staabm commented Jun 17, 2022

built errors seem unrelated

Comment on lines 8 to 9
assertType('int|null', sscanf($s, $s, $first, $second));
assertType('array|null', sscanf($s, $s));
Copy link
Member

Choose a reason for hiding this comment

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

Please change assertions of the existing sscanf('20-20', '%d-%d', $first, $second) test and add sscanf($s, $s, $first, $second) as a separate one.

@ondrejmirtes
Copy link
Member

Thank you!

@staabm staabm deleted the sscanf branch June 18, 2022 06:24
@Alkarex
Copy link

Alkarex commented Aug 9, 2022

Maybe a regression phpstan/phpstan#7764

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants