Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Gina Peter Banyard <girgias@php.net>
  • Loading branch information
TimWolla and Girgias committed Jul 8, 2024
1 parent d5af2de commit 3110205
Show file tree
Hide file tree
Showing 67 changed files with 451 additions and 301 deletions.
8 changes: 4 additions & 4 deletions ext/date/php_date.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ function checkdate(int $month, int $day, int $year): bool {}
/**
* @refcount 1
*/
#[\Deprecated]
#[\Deprecated(since: '8.1', message: 'use IntlDateFormatter::format() instead')]
function strftime(string $format, ?int $timestamp = null): string|false {}

/**
* @refcount 1
*/
#[\Deprecated]
#[\Deprecated(since: '8.1', message: 'use IntlDateFormatter::format() instead')]
function gmstrftime(string $format, ?int $timestamp = null): string|false {}

function time(): int {}
Expand Down Expand Up @@ -261,7 +261,7 @@ function date_default_timezone_get(): string {}
/**
* @refcount 1
*/
#[\Deprecated]
#[\Deprecated(since: '8.1', message: 'use date_sun_info() instead')]
function date_sunrise(
int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING,
?float $latitude = null, ?float $longitude = null, ?float $zenith = null,
Expand All @@ -270,7 +270,7 @@ function date_sunrise(
/**
* @refcount 1
*/
#[\Deprecated]
#[\Deprecated(since: '8.1', message: 'use date_sun_info() instead')]
function date_sunset(
int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING,
?float $latitude = null, ?float $longitude = null, ?float $zenith = null,
Expand Down
56 changes: 48 additions & 8 deletions ext/date/php_date_arginfo.h

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

16 changes: 8 additions & 8 deletions ext/date/tests/009.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,29 @@ var_dump(gmstrftime("blah", $t));
echo "Done\n";
?>
--EXPECTF--
Deprecated: Function strftime() is deprecated in %s on line %d
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
bool(false)

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

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

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

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

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

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

Deprecated: Function gmstrftime() is deprecated in %s on line %d
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
string(4) "blah"
Done
4 changes: 2 additions & 2 deletions ext/date/tests/bug65371.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ p('あ');
--EXPECTF--

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

Deprecated: Function strftime() is deprecated in %s on line %d
Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
e38182
8 changes: 4 additions & 4 deletions ext/date/tests/date_sunrise_and_sunset_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ var_dump(gettype(date_sunset(time())));
--EXPECTF--
Basic test for date_sunrise() and date_sunset()

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

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

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

Deprecated: Function date_sunset() is deprecated in %s on line %d
Deprecated: Function date_sunset() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
string(6) "string"
4 changes: 2 additions & 2 deletions ext/date/tests/date_sunrise_and_sunset_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ try {

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

Deprecated: Function date_sunset() is deprecated in %s on line %d
Deprecated: Function date_sunset() is deprecated since 8.1, use date_sun_info() instead in %s on line %d
date_sunset(): Argument #2 ($returnFormat) must be one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, or SUNFUNCS_RET_DOUBLE
4 changes: 2 additions & 2 deletions ext/date/tests/gmstrftime_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ var_dump( gmstrftime($format) );
--EXPECTF--
*** Testing gmstrftime() : basic functionality ***

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

Deprecated: Function gmstrftime() is deprecated in %s on line %d
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
string(%d) "%s %d %d %d:%d:%d"
8 changes: 4 additions & 4 deletions ext/date/tests/gmstrftime_variation10.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ foreach($inputs as $key =>$value) {

--The ISO 8601:1988 week number--

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

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

--Weekday as decimal--

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

Deprecated: Function gmstrftime() is deprecated in %s on line %d
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
string(1) "5"
4 changes: 2 additions & 2 deletions ext/date/tests/gmstrftime_variation11.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ var_dump( gmstrftime($format, $timestamp) );

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

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

Deprecated: Function gmstrftime() is deprecated in %s on line %d
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
string(3) "Aug"
4 changes: 2 additions & 2 deletions ext/date/tests/gmstrftime_variation12.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ var_dump( gmstrftime($format, $timestamp) );

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

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

Deprecated: Function gmstrftime() is deprecated in %s on line %d
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
string(3) "Aug"
16 changes: 8 additions & 8 deletions ext/date/tests/gmstrftime_variation13.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,32 @@ foreach($inputs as $key =>$value) {

--Century number--

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

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

--Month Date Year--

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

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

--Year with century--

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

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

--Year without century--

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

Deprecated: Function gmstrftime() is deprecated in %s on line %d
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
string(2) "08"
16 changes: 8 additions & 8 deletions ext/date/tests/gmstrftime_variation14.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,32 @@ foreach($inputs as $key =>$value) {

--Century number--

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

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

--Month Date Year--

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

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

--Year with century--

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

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

--Year without century--

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

Deprecated: Function gmstrftime() is deprecated in %s on line %d
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
string(2) "08"
12 changes: 6 additions & 6 deletions ext/date/tests/gmstrftime_variation15.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,24 @@ foreach($inputs as $key =>$value) {

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

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

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

--Time in 24 hour notation--

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

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

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

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

Deprecated: Function gmstrftime() is deprecated in %s on line %d
Deprecated: Function gmstrftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in %s on line %d
string(8) "08:08:08"
12 changes: 6 additions & 6 deletions ext/date/tests/gmstrftime_variation16.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,24 @@ foreach($inputs as $key =>$value) {

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

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

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

--Time in 24 hour notation--

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

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

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

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

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

0 comments on commit 3110205

Please sign in to comment.