Skip to content

Commit 5fe18aa

Browse files
TimWollaGirgias
andauthored
Apply suggestions from code review
Co-authored-by: Gina Peter Banyard <girgias@php.net>
1 parent ba9e932 commit 5fe18aa

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

ext/date/php_date.stub.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ function checkdate(int $month, int $day, int $year): bool {}
121121
/**
122122
* @refcount 1
123123
*/
124-
#[\Deprecated]
124+
#[\Deprecated(since: '8.1', message: 'use the IntlDateFormatter::format() method instead')]
125125
function strftime(string $format, ?int $timestamp = null): string|false {}
126126

127127
/**
128128
* @refcount 1
129129
*/
130-
#[\Deprecated]
130+
#[\Deprecated(since: '8.1', message: 'use the IntlDateFormatter::format() method instead')]
131131
function gmstrftime(string $format, ?int $timestamp = null): string|false {}
132132

133133
function time(): int {}
@@ -261,7 +261,7 @@ function date_default_timezone_get(): string {}
261261
/**
262262
* @refcount 1
263263
*/
264-
#[\Deprecated]
264+
#[\Deprecated(message: 'Use date_sun_info() instead', since: '8.1')]
265265
function date_sunrise(
266266
int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING,
267267
?float $latitude = null, ?float $longitude = null, ?float $zenith = null,
@@ -270,7 +270,7 @@ function date_sunrise(
270270
/**
271271
* @refcount 1
272272
*/
273-
#[\Deprecated]
273+
#[\Deprecated(message: 'Use date_sun_info() instead', since: '8.1')]
274274
function date_sunset(
275275
int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING,
276276
?float $latitude = null, ?float $longitude = null, ?float $zenith = null,

ext/enchant/enchant.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function enchant_dict_add(EnchantDictionary $dictionary, string $word): void {}
9090
/**
9191
* @alias enchant_dict_add
9292
*/
93-
#[\Deprecated(since: '8.1')]
93+
#[\Deprecated(since: '8.1', message: 'use enchant_dict_add() instead')]
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 {}
@@ -100,7 +100,7 @@ function enchant_dict_is_added(EnchantDictionary $dictionary, string $word): boo
100100
/**
101101
* @alias enchant_dict_is_added
102102
*/
103-
#[\Deprecated(since: '8.1')]
103+
#[\Deprecated(since: '8.1', message: 'use enchant_dict_is_added() instead')]
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/intl/php_intl.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ function intlcal_after(IntlCalendar $calendar, IntlCalendar $other): bool {}
201201

202202
function intlcal_before(IntlCalendar $calendar, IntlCalendar $other): bool {}
203203

204-
#[\Deprecated(since: '8.4')]
204+
#[\Deprecated(message: 'Use IntlCalendar::set(), IntlCalendar::setDate(), or IntlCalendar::setDateTime() instead', since: '8.4')]
205205
function intlcal_set(IntlCalendar $calendar, int $year, int $month, int $dayOfMonth = UNKNOWN, int $hour = UNKNOWN, int $minute = UNKNOWN, int $second = UNKNOWN): true {}
206206

207207
/** @param int|bool $value */
@@ -279,7 +279,7 @@ function intlcal_get_error_message(IntlCalendar $calendar): string|false {}
279279
* @param int $minute
280280
* @param int $second
281281
*/
282-
#[\Deprecated(since: '8.4')]
282+
#[\Deprecated(message: 'Use IntlGregorianCalendar::__construct(), IntlGregorianCalendar::createFromDate(), or IntlGregorianCalendar::createFromDateTime() instead', since: '8.4')]
283283
function intlgregcal_create_instance($timezoneOrYear = UNKNOWN, $localeOrMonth = UNKNOWN, $day = UNKNOWN, $hour = UNKNOWN, $minute = UNKNOWN, $second = UNKNOWN): ?IntlGregorianCalendar {}
284284

285285
function intlgregcal_set_gregorian_change(IntlGregorianCalendar $calendar, float $timestamp): bool {}

ext/openssl/openssl.stub.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ function openssl_x509_checkpurpose(OpenSSLCertificate|string $certificate, int $
443443

444444
function openssl_x509_read(OpenSSLCertificate|string $certificate): OpenSSLCertificate|false {}
445445

446-
#[\Deprecated]
446+
#[\Deprecated(message: 'OpenSSLCertificate object is freed automatically', since: '8.0')]
447447
function openssl_x509_free(OpenSSLCertificate $certificate): void {}
448448

449449
/**
@@ -507,13 +507,13 @@ function openssl_pkey_get_public($public_key): OpenSSLAsymmetricKey|false {}
507507
*/
508508
function openssl_get_publickey($public_key): OpenSSLAsymmetricKey|false {}
509509

510-
#[\Deprecated]
510+
#[\Deprecated(message: 'OpenSSLAsymmetricKey object is freed automatically', since: '8.0')]
511511
function openssl_pkey_free(OpenSSLAsymmetricKey $key): void {}
512512

513513
/**
514514
* @alias openssl_pkey_free
515515
*/
516-
#[\Deprecated]
516+
#[\Deprecated(message: 'OpenSSLAsymmetricKey object is freed automatically', since: '8.0')]
517517
function openssl_free_key(OpenSSLAsymmetricKey $key): void {}
518518

519519
/**

ext/pgsql/pgsql.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ function pg_field_prtlen(PgSql\Result $result, $row, string|int $field = UNKNOWN
666666
/**
667667
* @param string|int $row
668668
*/
669-
#[\Deprecated]
669+
#[\Deprecated(since: '8.0', message: 'use pg_field_prtlen() instead')]
670670
function pg_fieldprtlen(PgSql\Result $result, $row, string|int $field = UNKNOWN): int|false {}
671671

672672
/** @param string|int|null $row */
@@ -675,7 +675,7 @@ function pg_field_is_null(PgSql\Result $result, $row, string|int $field = UNKNOW
675675
/**
676676
* @param string|int $row
677677
*/
678-
#[\Deprecated]
678+
#[\Deprecated(since: '8.0', message: 'use pg_field_is_null() instead')]
679679
function pg_fieldisnull(PgSql\Result $result, $row, string|int $field = UNKNOWN): int|false {}
680680

681681
function pg_free_result(PgSql\Result $result): bool {}

ext/shmop/shmop.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function shmop_open(int $key, string $mode, int $permissions, int $size): Shmop|
1212

1313
function shmop_read(Shmop $shmop, int $offset, int $size): string {}
1414

15-
#[\Deprecated]
15+
#[\Deprecated(message: 'Shmop object is freed automatically', since: '8.0')]
1616
function shmop_close(Shmop $shmop): void {}
1717

1818
function shmop_size(Shmop $shmop): int {}

ext/standard/basic_functions.stub.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2138,7 +2138,7 @@ function crypt(#[\SensitiveParameter] string $string, string $salt): string {}
21382138
* @return array<string, int|string>|false
21392139
* @refcount 1
21402140
*/
2141-
#[\Deprecated]
2141+
#[\Deprecated(since: '8.2', message: 'use date_parse_from_format() (for locale-independent parsing), or IntlDateFormatter::parse() (for locale-dependent parsing) instead')]
21422142
function strptime(string $timestamp, string $format): array|false {}
21432143
#endif
21442144

@@ -2656,14 +2656,14 @@ function substr_compare(string $haystack, string $needle, int $offset, ?int $len
26562656
* @compile-time-eval
26572657
* @refcount 1
26582658
*/
2659-
#[\Deprecated]
2659+
#[\Deprecated(since: '8.2', message: 'visit the php.net documentation for various alternatives')]
26602660
function utf8_encode(string $string): string {}
26612661

26622662
/**
26632663
* @compile-time-eval
26642664
* @refcount 1
26652665
*/
2666-
#[\Deprecated]
2666+
#[\Deprecated(since: '8.2', message: 'visit the php.net documentation for various alternatives')]
26672667
function utf8_decode(string $string): string {}
26682668

26692669
/* dir.c */

0 commit comments

Comments
 (0)