Skip to content

Commit d65251e

Browse files
committedJul 17, 2023
Deprecate NumberFormater::TYPE_CURRENCY constant
1 parent 3e2dbbf commit d65251e

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed
 

‎ext/intl/formatter/formatter.stub.php

+1
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ class NumberFormatter
392392
public const TYPE_DOUBLE = UNKNOWN;
393393
/**
394394
* @var int
395+
* @deprecated
395396
* @cvalue FORMAT_TYPE_CURRENCY
396397
*/
397398
public const TYPE_CURRENCY = UNKNOWN;

‎ext/intl/formatter/formatter_arginfo.h

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
NumberFormatter::TYPE_CURRENCY is deprecated
3+
--EXTENSIONS--
4+
intl
5+
--FILE--
6+
<?php
7+
var_dump(NumberFormatter::TYPE_CURRENCY);
8+
var_dump(constant('NumberFormatter::TYPE_CURRENCY'));
9+
?>
10+
--EXPECTF--
11+
Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated in %s on line %d
12+
int(4)
13+
14+
Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated in %s on line %d
15+
int(4)

‎ext/intl/tests/formatter_format_and_parse_errors.phpt

+9-1
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,20 @@ try {
5454
}
5555

5656
?>
57-
--EXPECT--
57+
--EXPECTF--
5858
numfmt_format(): Argument #3 ($type) must be a NumberFormatter::TYPE_* constant
5959
NumberFormatter::format(): Argument #2 ($type) must be a NumberFormatter::TYPE_* constant
6060
numfmt_parse(): Argument #3 ($type) must be a NumberFormatter::TYPE_* constant
6161
NumberFormatter::parse(): Argument #2 ($type) must be a NumberFormatter::TYPE_* constant
62+
63+
Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated in %s on line %d
6264
numfmt_format(): Argument #3 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use numfmt_format_currency() function instead
65+
66+
Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated in %s on line %d
6367
NumberFormatter::format(): Argument #2 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use NumberFormatter::formatCurrency() method instead
68+
69+
Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated in %s on line %d
6470
numfmt_parse(): Argument #3 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use numfmt_parse_currency() function instead
71+
72+
Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated in %s on line %d
6573
NumberFormatter::parse(): Argument #2 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use NumberFormatter::parseCurrency() method instead

0 commit comments

Comments
 (0)
Please sign in to comment.