Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.6.0alpha1

- Intl:
. Added IntlNumberRangeFormatter class to format an interval of two numbers
with a given skeleton, locale, collapse type and identity fallback.
(BogdanUngureanu)

<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>
5 changes: 5 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ PHP 8.6 UPGRADE NOTES
2. New Features
========================================

- Intl:
. Added IntlNumberRangeFormatter class to format an interval of two numbers with a given skeleton, locale, IntlNumberRangeFormatter::COLLAPSE_AUTO, IntlNumberRangeFormatter::COLLAPSE_NONE, IntlNumberRangeFormatter::COLLAPSE_UNIT, IntlNumberRangeFormatter::COLLAPSE_ALL collapse and
IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY and
IntlNumberRangeFormatter::IDENTITY_FALLBACK_RANGE identity fallbacks.
It is supported from icu 63.
========================================
3. Changes in SAPI modules
========================================
Expand Down
2 changes: 2 additions & 0 deletions ext/intl/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ if test "$PHP_INTL" != "no"; then
dateformat/datepatterngenerator_class.cpp \
dateformat/datepatterngenerator_methods.cpp \
msgformat/msgformat_helpers.cpp \
rangeformatter/rangeformatter_class.cpp \
timezone/timezone_class.cpp \
timezone/timezone_methods.cpp \
calendar/calendar_class.cpp \
Expand Down Expand Up @@ -123,6 +124,7 @@ if test "$PHP_INTL" != "no"; then
$ext_builddir/listformatter
$ext_builddir/msgformat
$ext_builddir/normalizer
$ext_builddir/rangeformatter
$ext_builddir/resourcebundle
$ext_builddir/spoofchecker
$ext_builddir/timezone
Expand Down
3 changes: 3 additions & 0 deletions ext/intl/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ if (PHP_INTL != "no") {
normalizer_class.cpp \
normalizer_normalize.cpp \
", "intl");
ADD_SOURCES(configure_module_dirname + "/rangeformatter", "\
rangeformatter_class.cpp \
", "intl");
ADD_SOURCES(configure_module_dirname + "/dateformat", "\
dateformat.c \
dateformat_class.c \
Expand Down
4 changes: 4 additions & 0 deletions ext/intl/php_intl.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "locale/locale_class.h"

#include "listformatter/listformatter_class.h"
#include "rangeformatter/rangeformatter_class.h"

#include "dateformat/dateformat.h"
#include "dateformat/dateformat_class.h"
Expand Down Expand Up @@ -189,6 +190,9 @@ PHP_MINIT_FUNCTION( intl )
/* Register 'ListFormatter' PHP class */
listformatter_register_class( );

/* Register 'NumberRangeFormatter' PHP class */
rangeformatter_register_class( );

/* Register 'Normalizer' PHP class */
normalizer_register_Normalizer_class( );

Expand Down
61 changes: 61 additions & 0 deletions ext/intl/rangeformatter/rangeformatter.stub.php
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 {
#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 {}
}
148 changes: 148 additions & 0 deletions ext/intl/rangeformatter/rangeformatter_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading