Skip to content

Conversation

zonuexe
Copy link
Contributor

@zonuexe zonuexe commented Oct 17, 2022

Type mb_convert_case() and mb_convert_kana() with StrCaseFunctionsReturnTypeExtension.

Strictly speaking, Japanese kana characters are not casing, but many of the treatments are common.

}

$constantStrings = array_map(fn ($type) => $type->getValue(), TypeUtils::getConstantStrings($argType));
if (count($constantStrings) > 0 && mb_check_encoding($constantStrings, 'UTF-8')) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

mb_check_encoding() seems to accept arrays in PHP 7.2.0 and above.

https://3v4l.org/GlVUu

@ondrejmirtes ondrejmirtes changed the title Add support mb_convert_case() and mb_convert_kana() to TypeSpecifier Add support for mb_convert_case() and mb_convert_kana() Oct 21, 2022
@ondrejmirtes ondrejmirtes merged commit a75cea2 into phpstan:1.9.x Oct 21, 2022
@ondrejmirtes
Copy link
Member

Thank you!

@staabm
Copy link
Contributor

staabm commented Oct 21, 2022

@zonuexe it seems this one requires a fix for the test-expectations in the php 7.2

https://github.com/phpstan/phpstan-src/actions/runs/3269863209/jobs/5377858799

@ondrejmirtes
Copy link
Member

Fixed it the easiest way: 0a4c52c

@zonuexe zonuexe deleted the add-case-folding-functions branch October 21, 2022 15:04
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.

3 participants