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

mb_* fatal errors on php8 with invalid encoding #969

Merged
merged 2 commits into from Feb 14, 2022

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Feb 1, 2022

@ondrejmirtes
Copy link
Member

A new rule to check this would be nice!

@staabm staabm marked this pull request as ready for review February 13, 2022 22:59
@staabm
Copy link
Contributor Author

staabm commented Feb 13, 2022

Do you think we could merge this without a new rule?

I have other priorities atm

@@ -86,9 +88,14 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection,
}

if (count($results) === 1) {
$invalidEncodingReturn = new ConstantBooleanType(false);
if ($this->phpVersion->getVersionId() >= 80000) {
Copy link
Member

Choose a reason for hiding this comment

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

This needs a descriptive method instead. Check the class if there's already a method that would match the situation, otherwise implement 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.

implemented PhpVersion->throwsOnInvalidMbStringEncoding()

@ondrejmirtes ondrejmirtes merged commit 832a9a1 into phpstan:master Feb 14, 2022
@ondrejmirtes
Copy link
Member

Thank you.

@staabm staabm deleted the invalid-encoding branch February 14, 2022 10:06
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