Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 8.1k
Intl: Add a new IntlNumberRangeFormatter class#19232
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
51cd7a15133aabd7ba5ffaebecd3c54647327da6a108aa56cd0cc2a0aee4911128a3b66ef31d6ad4de3b6e272153603655File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| <?php | ||
| /** @generate-class-entries */ | ||
| /** | ||
| * @not-serializable | ||
| * @strict-properties | ||
| */ | ||
| final class IntlNumberRangeFormatter { | ||
BogdanUngureanu marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| #if U_ICU_VERSION_MAJOR_NUM >= 63 | ||
| /** @cvalue UNUM_RANGE_COLLAPSE_AUTO */ | ||
| public const int COLLAPSE_AUTO = UNKNOWN; | ||
| /** @cvalue UNUM_RANGE_COLLAPSE_NONE */ | ||
| public const int COLLAPSE_NONE = UNKNOWN; | ||
| /** @cvalue UNUM_RANGE_COLLAPSE_UNIT */ | ||
| public const int COLLAPSE_UNIT = UNKNOWN; | ||
| /** @cvalue UNUM_RANGE_COLLAPSE_ALL */ | ||
| public const int COLLAPSE_ALL = UNKNOWN; | ||
| /** @cvalue UNUM_IDENTITY_FALLBACK_SINGLE_VALUE */ | ||
| public const int IDENTITY_FALLBACK_SINGLE_VALUE = UNKNOWN; | ||
| /** @cvalue UNUM_IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE */ | ||
| public const int IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE = UNKNOWN; | ||
| /** @cvalue UNUM_IDENTITY_FALLBACK_APPROXIMATELY */ | ||
| public const int IDENTITY_FALLBACK_APPROXIMATELY = UNKNOWN; | ||
| /** @cvalue UNUM_IDENTITY_FALLBACK_RANGE */ | ||
| public const int IDENTITY_FALLBACK_RANGE = UNKNOWN; | ||
| #else | ||
| public const int COLLAPSE_AUTO = 0; | ||
| public const int COLLAPSE_NONE = 1; | ||
| public const int COLLAPSE_UNIT = 2; | ||
| public const int COLLAPSE_ALL = 3; | ||
| public const int IDENTITY_FALLBACK_SINGLE_VALUE = 0; | ||
| public const int IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE = 1; | ||
| public const int IDENTITY_FALLBACK_APPROXIMATELY = 2; | ||
| public const int IDENTITY_FALLBACK_RANGE = 3; | ||
| #endif | ||
| private function __construct() {} | ||
| public static function createFromSkeleton(string $skeleton, string $locale, int $collapse, int $identityFallback): IntlNumberRangeFormatter {} | ||
| ||
| public function format(float|int $start, float|int $end): string {} | ||
| public function getErrorCode(): int {} | ||
| public function getErrorMessage(): string {} | ||
| } | ||
BogdanUngureanu marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: each constant need to have their own line and short introduction like here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.. I think those are constants, not class constants. I've followed the example we've used for IntlListFormatter from here:
php-src/UPGRADING
Line 269 in 8a10141
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah you have a point here