Skip to content

Conversation

cfahner
Copy link

@cfahner cfahner commented Jul 10, 2025

For issue #12942 I updated the signatures of the following functions:

  • locale_get_display_language() and Locale::getDisplayLanguage()
  • locale_get_display_name() and Locale::getDisplayName()
  • locale_get_display_region() and Locale::getDisplayRegion()
  • locale_get_display_script() and Locale::getDisplayScript()
  • locale_get_display_variant() and Locale::getDisplayVariant()

The _language() and _name() variants never seem to return an empty string (at least I could not find any case for which they did), so I left them at non-empty-string.

The _region() function returns an empty string when you give it a language code without a region.

When you pass in a very long string these methods all return false (C source code).

I added my quick testing script as an attachment. This is my first PR here so let me know if there are any other requirement.

test.zip

@ondrejmirtes ondrejmirtes merged commit 1164c64 into phpstan:2.1.x Jul 17, 2025
417 of 420 checks passed
@ondrejmirtes
Copy link
Member

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

Development

Successfully merging this pull request may close these issues.

2 participants