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

Add dynamic return type extension for mb_substitute_character #607

Merged

Conversation

TRowbotham
Copy link
Contributor

No description provided.

@TRowbotham
Copy link
Contributor Author

What is the best way to fix the failing test in PHP 7.1 since the integer range depends on the PHP version? I could add a third test file, but that seems overkill.

@staabm
Copy link
Contributor

staabm commented Aug 2, 2021

I could add a third test file, but that seems overkill.

kind of agree.

maybe run the data/mb_substitute_character.php only on php 7.2+ and leave php 7.1 alone?

another alternative could be dropping the single assertion \PHPStan\Testing\assertType('\'entity\'|\'long\'|\'none\'|int<0, 1114111>', mb_substitute_character()); for the php 7.x test

@TRowbotham
Copy link
Contributor Author

I went with skipping the test on PHP 7.1. I tried using an if statement in the test file, but that didn't seem to work.

@TRowbotham TRowbotham force-pushed the mb_substitute_character_dynamic_return branch from 87e9f1d to a11e33a Compare August 14, 2021 18:45
@ondrejmirtes ondrejmirtes force-pushed the mb_substitute_character_dynamic_return branch from e80990c to fcaff2e Compare August 15, 2021 14:29
@ondrejmirtes ondrejmirtes merged commit cee6f68 into phpstan:master Aug 15, 2021
@ondrejmirtes
Copy link
Member

Perfect, thank you!

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