Skip to content

Add various stubs for Intl #4819

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

Closed
wants to merge 8 commits into from

Conversation

kocsismate
Copy link
Member

Stubs for the following components:

  • IDN
  • Grapheme
  • Spoofchecker
  • Normalizer
  • ResourceBundle

Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

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

LG apart from one nit in resourcebundle_create.

}

/** @return ResourceBundle|false|null */
function resourcebundle_create(?string $locale, ?string $bundlename, bool $fallback = true) {}
Copy link
Member

Choose a reason for hiding this comment

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

: ResourceBundle|false|null should work now?

Copy link
Member

Choose a reason for hiding this comment

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

Also, I don't think false is possible here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, I am fixing this right now.

*/
function resourcebundle_get(ResourceBundle $bundle, $index) {}

function resourcebundle_count(ResourceBundle $bundle): int|false {}
Copy link
Member

Choose a reason for hiding this comment

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

We should convert the "unconstructed" case into a hard Error exception in the future.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd like this change! Will provide a PR sometime soon.

kocsismate added a commit to kocsismate/php-src that referenced this pull request Jan 3, 2020
Closes phpGH-4819
- Add stubs for idn functions
- Add stubs for grapheme functions
- Add stubs for Spoofchecker
- Add stubs for Normalizer
- Add stubs for ResourceBundle
- Fix arginfos
- Add support for union return types
- Fix arginfo for resourcebundle_create()
@php-pulls php-pulls closed this in e08ce4c Jan 3, 2020
@kocsismate kocsismate deleted the intl-various-stubs branch January 3, 2020 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants