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

Use ReturnTypeExtension for mb_str_split #379

Merged
merged 1 commit into from Nov 26, 2020

Conversation

VincentLanglet
Copy link
Contributor

@VincentLanglet VincentLanglet commented Nov 23, 2020

Shouldn't mb_str_split work as str_split ? @ondrejmirtes

I can add tests if you think it's right.

Copy link
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

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

And a test. See where str_split is already tested.

@@ -21,7 +21,8 @@ final class StrSplitFunctionReturnTypeExtension implements DynamicFunctionReturn

public function isFunctionSupported(FunctionReflection $functionReflection): bool
{
return $functionReflection->getName() === 'str_split';
return $functionReflection->getName() === 'str_split'
|| $functionReflection->getName() === 'mb_str_split';
Copy link
Member

Choose a reason for hiding this comment

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

Use in_array please.

@VincentLanglet
Copy link
Contributor Author

@ondrejmirtes The PR seems fine to me now. But all the test are failing weirdly.

@ondrejmirtes ondrejmirtes merged commit 60d744f into phpstan:master Nov 26, 2020
@ondrejmirtes
Copy link
Member

Thank you!

@ondrejmirtes
Copy link
Member

I fixed the CI with: ef6ca4a

Something weird is going on with latest version of nette/di...

@VincentLanglet VincentLanglet deleted the patch-1 branch November 26, 2020 13:20
@VincentLanglet
Copy link
Contributor Author

Thank you!

Thanks you too.
I look forward the next release to fix all the false-positive I got when I change str_plit into mb_str_split.

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