Skip to content

Commit 4045cf3

Browse files
TimWollaGirgias
andcommitted
Replace @deprecated by #[\Deprecated] for internal functions / class constants
Co-authored-by: Gina Peter Banyard <girgias@php.net>
1 parent 9caad37 commit 4045cf3

File tree

79 files changed

+733
-215
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+733
-215
lines changed

Zend/tests/bug69802_2.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ $r = new ReflectionMethod($f, '__invoke');
77
var_dump($r->getParameters()[0]->getClass());
88
?>
99
--EXPECTF--
10-
Deprecated: Method ReflectionParameter::getClass() is deprecated in %s on line %d
10+
Deprecated: Method ReflectionParameter::getClass() is deprecated, use ReflectionParameter::getType() instead in %s on line %d
1111
object(ReflectionClass)#4 (1) {
1212
["name"]=>
1313
string(11) "Traversable"

Zend/tests/type_declarations/callable_002.phpt

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ var_dump($rc->getParameters()[0]->isCallable());
2121

2222
?>
2323
--EXPECTF--
24-
Deprecated: Method ReflectionParameter::isCallable() is deprecated in %s on line %d
24+
Deprecated: Method ReflectionParameter::isCallable() is deprecated, use ReflectionParameter::getType() instead in %s on line %d
2525
bool(true)
2626

27-
Deprecated: Method ReflectionParameter::isCallable() is deprecated in %s on line %d
27+
Deprecated: Method ReflectionParameter::isCallable() is deprecated, use ReflectionParameter::getType() instead in %s on line %d
2828
bool(true)
2929

30-
Deprecated: Method ReflectionParameter::isCallable() is deprecated in %s on line %d
30+
Deprecated: Method ReflectionParameter::isCallable() is deprecated, use ReflectionParameter::getType() instead in %s on line %d
3131
bool(true)

ext/date/php_date.c

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "ext/standard/info.h"
2121
#include "ext/standard/php_versioning.h"
2222
#include "php_date.h"
23+
#include "zend_attributes.h"
2324
#include "zend_interfaces.h"
2425
#include "zend_exceptions.h"
2526
#include "lib/timelib.h"

ext/date/php_date.stub.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ function checkdate(int $month, int $day, int $year): bool {}
120120

121121
/**
122122
* @refcount 1
123-
* @deprecated
124123
*/
124+
#[\Deprecated]
125125
function strftime(string $format, ?int $timestamp = null): string|false {}
126126

127127
/**
128128
* @refcount 1
129-
* @deprecated
130129
*/
130+
#[\Deprecated]
131131
function gmstrftime(string $format, ?int $timestamp = null): string|false {}
132132

133133
function time(): int {}
@@ -260,17 +260,17 @@ function date_default_timezone_get(): string {}
260260

261261
/**
262262
* @refcount 1
263-
* @deprecated
264263
*/
264+
#[\Deprecated]
265265
function date_sunrise(
266266
int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING,
267267
?float $latitude = null, ?float $longitude = null, ?float $zenith = null,
268268
?float $utcOffset = null): string|int|float|false {}
269269

270270
/**
271271
* @refcount 1
272-
* @deprecated
273272
*/
273+
#[\Deprecated]
274274
function date_sunset(
275275
int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING,
276276
?float $latitude = null, ?float $longitude = null, ?float $zenith = null,

ext/date/php_date_arginfo.h

+10-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/enchant/enchant.c

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "php.h"
2323
#include "php_ini.h"
2424
#include "ext/standard/info.h"
25+
#include "Zend/zend_attributes.h"
2526
#include "Zend/zend_exceptions.h"
2627
#include <enchant.h>
2728
#include "php_enchant.h"

ext/enchant/enchant.stub.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ final class EnchantDictionary
4040

4141
function enchant_broker_init(): EnchantBroker|false {}
4242

43-
/** @deprecated */
43+
#[\Deprecated(message: 'EnchantBroker object is freed automatically', since: '8.1')]
4444
function enchant_broker_free(EnchantBroker $broker): bool {}
4545

4646
function enchant_broker_get_error(EnchantBroker $broker): string|false {}
4747

48-
/** @deprecated */
48+
#[\Deprecated(since: '8.1')]
4949
function enchant_broker_set_dict_path(EnchantBroker $broker, int $type, string $path): bool {}
5050

51-
/** @deprecated */
51+
#[\Deprecated(since: '8.1')]
5252
function enchant_broker_get_dict_path(EnchantBroker $broker, int $type): string|false {}
5353

5454
/**
@@ -61,7 +61,7 @@ function enchant_broker_request_dict(EnchantBroker $broker, string $tag): Enchan
6161

6262
function enchant_broker_request_pwl_dict(EnchantBroker $broker, string $filename): EnchantDictionary|false {}
6363

64-
/** @deprecated */
64+
#[\Deprecated(message: 'EnchantDictionary object is freed automatically', since: '8.1')]
6565
function enchant_broker_free_dict(EnchantDictionary $dictionary): bool {}
6666

6767
function enchant_broker_dict_exists(EnchantBroker $broker, string $tag): bool {}
@@ -89,8 +89,8 @@ function enchant_dict_add(EnchantDictionary $dictionary, string $word): void {}
8989

9090
/**
9191
* @alias enchant_dict_add
92-
* @deprecated
9392
*/
93+
#[\Deprecated(since: '8.1')]
9494
function enchant_dict_add_to_personal(EnchantDictionary $dictionary, string $word): void {}
9595

9696
function enchant_dict_add_to_session(EnchantDictionary $dictionary, string $word): void {}
@@ -99,8 +99,8 @@ function enchant_dict_is_added(EnchantDictionary $dictionary, string $word): boo
9999

100100
/**
101101
* @alias enchant_dict_is_added
102-
* @deprecated
103102
*/
103+
#[\Deprecated(since: '8.1')]
104104
function enchant_dict_is_in_session(EnchantDictionary $dictionary, string $word): bool {}
105105

106106
function enchant_dict_store_replacement(EnchantDictionary $dictionary, string $misspelled, string $correct): void {}

ext/enchant/enchant_arginfo.h

+54-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/enchant/tests/broker_free.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ echo "OK\n";
2323
--EXPECTF--
2424
OK
2525

26-
Deprecated: Function enchant_broker_free() is deprecated in %s
26+
Deprecated: Function enchant_broker_free() is deprecated since 8.1, EnchantBroker object is freed automatically in %s
2727
OK

ext/enchant/tests/broker_free_dict.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ OK
5050
OK
5151
NULL
5252

53-
Deprecated: Function enchant_broker_free_dict() is deprecated in %s
53+
Deprecated: Function enchant_broker_free_dict() is deprecated since 8.1, EnchantDictionary object is freed automatically in %s
5454
OK
5555
OK

ext/enchant/tests/bug53070.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ var_dump(enchant_broker_get_dict_path($broker, ENCHANT_ISPELL));
1616
--EXPECTF--
1717
Deprecated: Constant ENCHANT_MYSPELL is deprecated in %s
1818

19-
Deprecated: Function enchant_broker_get_dict_path() is deprecated in %s
19+
Deprecated: Function enchant_broker_get_dict_path() is deprecated since 8.1 in %s
2020

2121
Warning: enchant_broker_get_dict_path(): dict_path not set in %s on line %d
2222
bool(false)
2323

2424
Deprecated: Constant ENCHANT_ISPELL is deprecated in %s
2525

26-
Deprecated: Function enchant_broker_get_dict_path() is deprecated in %s
26+
Deprecated: Function enchant_broker_get_dict_path() is deprecated since 8.1 in %s
2727

2828
Warning: enchant_broker_get_dict_path(): dict_path not set in %s on line %d
2929
bool(false)

ext/enchant/tests/enchant_broker_set_dict_path.phpt

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ if (is_object($broker)) {
5151
--EXPECTF--
5252
OK
5353

54-
Deprecated: Function enchant_broker_set_dict_path() is deprecated in %s
54+
Deprecated: Function enchant_broker_set_dict_path() is deprecated since 8.1 in %s
5555
OK
5656

57-
Deprecated: Function enchant_broker_set_dict_path() is deprecated in %s
57+
Deprecated: Function enchant_broker_set_dict_path() is deprecated since 8.1 in %s
5858
OK
5959

60-
Deprecated: Function enchant_broker_get_dict_path() is deprecated in %s
60+
Deprecated: Function enchant_broker_get_dict_path() is deprecated since 8.1 in %s
6161

62-
Deprecated: Function enchant_broker_get_dict_path() is deprecated in %s
62+
Deprecated: Function enchant_broker_get_dict_path() is deprecated since 8.1 in %s
6363
OK

ext/hash/hash.stub.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -70,28 +70,28 @@ function hash_equals(#[\SensitiveParameter] string $known_string, #[\SensitivePa
7070
function hash_hkdf(string $algo, #[\SensitiveParameter] string $key, int $length = 0, string $info = "", string $salt = ""): string {}
7171

7272
#ifdef PHP_MHASH_BC
73-
/** @deprecated */
73+
#[\Deprecated]
7474
function mhash_get_block_size(int $algo): int|false {}
7575

7676
/**
7777
* @refcount 1
78-
* @deprecated
7978
*/
79+
#[\Deprecated]
8080
function mhash_get_hash_name(int $algo): string|false {}
8181

8282
/**
8383
* @refcount 1
84-
* @deprecated
8584
*/
85+
#[\Deprecated]
8686
function mhash_keygen_s2k(int $algo, string $password, string $salt, int $length): string|false {}
8787

88-
/** @deprecated */
88+
#[\Deprecated]
8989
function mhash_count(): int {}
9090

9191
/**
9292
* @refcount 1
93-
* @deprecated
9493
*/
94+
#[\Deprecated]
9595
function mhash(int $algo, string $data, ?string $key = null): string|false {}
9696
#endif
9797

ext/hash/hash_arginfo.h

+21-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/intl/formatter/formatter.stub.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ class NumberFormatter
180180
/** @cvalue FORMAT_TYPE_DOUBLE */
181181
public const int TYPE_DOUBLE = UNKNOWN;
182182
/**
183-
* @deprecated
184183
* @cvalue FORMAT_TYPE_CURRENCY
185184
*/
185+
#[\Deprecated(since: '8.3')]
186186
public const int TYPE_CURRENCY = UNKNOWN;
187187

188188
public function __construct(string $locale, int $style, ?string $pattern = null) {}

ext/intl/formatter/formatter_arginfo.h

+10-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/intl/formatter/formatter_class.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818
#include "php_intl.h"
1919
#include "formatter_data.h"
2020
#include "formatter_format.h"
21-
#include "formatter_arginfo.h"
2221

2322
#include <zend_exceptions.h>
23+
#include "Zend/zend_attributes.h"
2424
#include "Zend/zend_interfaces.h"
2525

26+
#include "formatter_arginfo.h"
27+
2628
zend_class_entry *NumberFormatter_ce_ptr = NULL;
2729
static zend_object_handlers NumberFormatter_handlers;
2830

ext/intl/php_intl.c

+2
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@
7272

7373
#include "php_ini.h"
7474

75+
#include "zend_attributes.h"
76+
7577
#include "php_intl_arginfo.h"
7678

7779
/*

0 commit comments

Comments
 (0)