Skip to content

Commit 3110205

Browse files
TimWollaGirgias
andcommitted
Apply suggestions from code review
Co-authored-by: Gina Peter Banyard <[email protected]>
1 parent d5af2de commit 3110205

File tree

67 files changed

+451
-301
lines changed

Some content is hidden

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

67 files changed

+451
-301
lines changed

ext/date/php_date.stub.php

+4-4
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 IntlDateFormatter::format() 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 IntlDateFormatter::format() 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(since: '8.1', message: 'use date_sun_info() instead')]
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(since: '8.1', message: 'use date_sun_info() instead')]
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

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

ext/date/tests/009.phpt

+8-8
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,29 @@ var_dump(gmstrftime("blah", $t));
2323
echo "Done\n";
2424
?>
2525
--EXPECTF--
26-
Deprecated: Function strftime() is deprecated in %s on line %d
26+
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
2727
bool(false)
2828

29-
Deprecated: Function strftime() is deprecated in %s on line %d
29+
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3030
string(%d) "Tue Tuesday Jun June Tue Jun 27 00:00:00 2006 %s
3131
%s %"
3232

33-
Deprecated: Function strftime() is deprecated in %s on line %d
33+
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3434
string(5) "%q %a"
3535

36-
Deprecated: Function strftime() is deprecated in %s on line %d
36+
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3737
string(4) "blah"
3838

39-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
39+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4040
bool(false)
4141

42-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
42+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4343
string(%d) "Mon Monday Jun June Mon Jun 26 21:00:00 2006 %s
4444
%s %"
4545

46-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
46+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4747
string(5) "%q %a"
4848

49-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
49+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5050
string(4) "blah"
5151
Done

ext/date/tests/bug65371.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ p('あ');
1919
--EXPECTF--
2020
2121

22-
Deprecated: Function strftime() is deprecated in %s on line %d
22+
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
2323
2424
e38182
2525

26-
Deprecated: Function strftime() is deprecated in %s on line %d
26+
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
2727
e38182

ext/date/tests/date_sunrise_and_sunset_basic.phpt

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ var_dump(gettype(date_sunset(time())));
2525
--EXPECTF--
2626
Basic test for date_sunrise() and date_sunset()
2727

28-
Deprecated: Function date_sunrise() is deprecated in %s on line %d
28+
Deprecated: Function date_sunrise() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
2929
%s %s %d %d, sunrise time : %d:%d
3030

31-
Deprecated: Function date_sunset() is deprecated in %s on line %d
31+
Deprecated: Function date_sunset() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
3232
%s %s %d %d, sunset time : %d:%d
3333

34-
Deprecated: Function date_sunrise() is deprecated in %s on line %d
34+
Deprecated: Function date_sunrise() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
3535
string(6) "string"
3636

37-
Deprecated: Function date_sunset() is deprecated in %s on line %d
37+
Deprecated: Function date_sunset() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
3838
string(6) "string"

ext/date/tests/date_sunrise_and_sunset_error.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ try {
1717

1818
?>
1919
--EXPECTF--
20-
Deprecated: Function date_sunrise() is deprecated in %s on line %d
20+
Deprecated: Function date_sunrise() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
2121
date_sunrise(): Argument #2 ($returnFormat) must be one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, or SUNFUNCS_RET_DOUBLE
2222

23-
Deprecated: Function date_sunset() is deprecated in %s on line %d
23+
Deprecated: Function date_sunset() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
2424
date_sunset(): Argument #2 ($returnFormat) must be one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, or SUNFUNCS_RET_DOUBLE

ext/date/tests/gmstrftime_basic.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ var_dump( gmstrftime($format) );
1818
--EXPECTF--
1919
*** Testing gmstrftime() : basic functionality ***
2020

21-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
21+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
2222
string(20) "Aug 08 2008 08:08:08"
2323

24-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
24+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
2525
string(%d) "%s %d %d %d:%d:%d"

ext/date/tests/gmstrftime_variation10.phpt

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ foreach($inputs as $key =>$value) {
3535

3636
--The ISO 8601:1988 week number--
3737

38-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
38+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3939
string(%d) "%d"
4040

41-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
41+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4242
string(2) "32"
4343

4444
--Weekday as decimal--
4545

46-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
46+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4747
string(%d) "%d"
4848

49-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
49+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5050
string(1) "5"

ext/date/tests/gmstrftime_variation11.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ var_dump( gmstrftime($format, $timestamp) );
2020

2121
-- Testing gmstrftime() function with Abbreviated month name format %h --
2222

23-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
23+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
2424
string(%d) "%s"
2525

26-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
26+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
2727
string(3) "Aug"

ext/date/tests/gmstrftime_variation12.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ var_dump( gmstrftime($format, $timestamp) );
2626

2727
-- Testing gmstrftime() function with Abbreviated month name format %h --
2828

29-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
29+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3030
string(%d) "%s"
3131

32-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
32+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3333
string(3) "Aug"

ext/date/tests/gmstrftime_variation13.phpt

+8-8
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,32 @@ foreach($inputs as $key =>$value) {
3131

3232
--Century number--
3333

34-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
34+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3535
string(2) "%d"
3636

37-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
37+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3838
string(2) "20"
3939

4040
--Month Date Year--
4141

42-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
42+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4343
string(%d) "%d/%d/%d"
4444

45-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
45+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4646
string(8) "08/08/08"
4747

4848
--Year with century--
4949

50-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
50+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5151
string(%d) "%d"
5252

53-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
53+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5454
string(4) "2008"
5555

5656
--Year without century--
5757

58-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
58+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5959
string(2) "%d"
6060

61-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
61+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
6262
string(2) "08"

ext/date/tests/gmstrftime_variation14.phpt

+8-8
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,32 @@ foreach($inputs as $key =>$value) {
3737

3838
--Century number--
3939

40-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
40+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4141
string(%d) "%d"
4242

43-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
43+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4444
string(2) "20"
4545

4646
--Month Date Year--
4747

48-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
48+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4949
string(%d) "%d/%d/%d"
5050

51-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
51+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5252
string(8) "08/08/08"
5353

5454
--Year with century--
5555

56-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
56+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5757
string(%d) "%d"
5858

59-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
59+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
6060
string(4) "2008"
6161

6262
--Year without century--
6363

64-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
64+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
6565
string(%d) "%d"
6666

67-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
67+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
6868
string(2) "08"

ext/date/tests/gmstrftime_variation15.phpt

+6-6
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,24 @@ foreach($inputs as $key =>$value) {
3030

3131
--Time in a.m/p.m notation--
3232

33-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
33+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3434
string(%d) "%d:%d:%d %c%c"
3535

36-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
36+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
3737
string(11) "08:08:08 AM"
3838

3939
--Time in 24 hour notation--
4040

41-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
41+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4242
string(%d) "%d:%d"
4343

44-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
44+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4545
string(5) "08:08"
4646

4747
--Current time %H:%M:%S format--
4848

49-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
49+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5050
string(%d) "%d:%d:%d"
5151

52-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
52+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5353
string(8) "08:08:08"

ext/date/tests/gmstrftime_variation16.phpt

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,24 @@ foreach($inputs as $key =>$value) {
3636

3737
--Time in a.m/p.m notation--
3838

39-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
39+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4040
string(%d) "%d:%d:%d %s"
4141

42-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
42+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4343
string(11) "02:08:08 PM"
4444

4545
--Time in 24 hour notation--
4646

47-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
47+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
4848
string(%d) "%d:%d"
4949

50-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
50+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5151
string(5) "14:08"
5252

5353
--Current time %H:%M:%S format--
5454

55-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
55+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5656
string(%d) "%d:%d:%d"
5757

58-
Deprecated: Function gmstrftime() is deprecated in %s on line %d
58+
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
5959
string(8) "14:08:08"

0 commit comments

Comments
 (0)