Skip to content

Commit 4898a5f

Browse files
committed
Singular DateTime::[get|set]Microsecond & no tentative return type
1 parent 98bd66f commit 4898a5f

File tree

6 files changed

+81
-85
lines changed

6 files changed

+81
-85
lines changed

NEWS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ PHP NEWS
2222

2323
- Date:
2424
. Added DateTime[Immutable]::createFromTimestamp. (Marc Bennewitz)
25-
. Added DateTime[Immutable]::[get|set]Microseconds. (Marc Bennewitz)
25+
. Added DateTime[Immutable]::[get|set]Microsecond. (Marc Bennewitz)
2626

2727
- DOM:
2828
. Added DOMNode::compareDocumentPosition(). (nielsdos)

UPGRADING

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ PHP 8.4 UPGRADE NOTES
168168
- Date:
169169
. Added static methods
170170
DateTime[Immutable]::createFromTimestamp(int|float $timestamp): static.
171-
. Added method DateTime[Immutable]::getMicroseconds(): int.
171+
. Added method DateTime[Immutable]::getMicrosecond(): int.
172172
. Added method
173-
DateTime[Immutable]::setMicroseconds(int $microseconds): static.
173+
DateTime[Immutable]::setMicrosecond(int $microsecond): static.
174174

175175
- DOM:
176176
. Added constant DOMNode::DOCUMENT_POSITION_DISCONNECTED.

ext/date/php_date.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2377,15 +2377,15 @@ static void update_errors_warnings(timelib_error_container **last_errors) /* {{{
23772377
*last_errors = NULL;
23782378
} /* }}} */
23792379

2380-
static void php_date_set_time_fraction(timelib_time *time, int microseconds)
2380+
static void php_date_set_time_fraction(timelib_time *time, int microsecond)
23812381
{
2382-
time->us = microseconds;
2382+
time->us = microsecond;
23832383
}
23842384

23852385
static void php_date_get_current_time_with_fraction(time_t *sec, suseconds_t *usec)
23862386
{
23872387
#if HAVE_GETTIMEOFDAY
2388-
struct timeval tp = {0}; /* For setting microseconds */
2388+
struct timeval tp = {0}; /* For setting microsecond */
23892389

23902390
gettimeofday(&tp, NULL);
23912391
*sec = tp.tv_sec;
@@ -3855,7 +3855,7 @@ PHP_METHOD(DateTimeImmutable, setTimestamp)
38553855
/* }}} */
38563856

38573857
/* {{{ */
3858-
PHP_METHOD(DateTimeImmutable, setMicroseconds)
3858+
PHP_METHOD(DateTimeImmutable, setMicrosecond)
38593859
{
38603860
zval *object, new_object;
38613861
php_date_obj *dateobj, *new_dateobj;
@@ -3889,7 +3889,7 @@ PHP_METHOD(DateTimeImmutable, setMicroseconds)
38893889
/* }}} */
38903890

38913891
/* {{{ */
3892-
PHP_METHOD(DateTime, setMicroseconds)
3892+
PHP_METHOD(DateTime, setMicrosecond)
38933893
{
38943894
zval *object;
38953895
php_date_obj *dateobj;
@@ -3947,7 +3947,7 @@ PHP_FUNCTION(date_timestamp_get)
39473947
}
39483948
/* }}} */
39493949

3950-
PHP_METHOD(DateTime, getMicroseconds) /* {{{ */
3950+
PHP_METHOD(DateTime, getMicrosecond) /* {{{ */
39513951
{
39523952
zval *object;
39533953
php_date_obj *dateobj;

ext/date/php_date.stub.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,7 @@ public function setTimezone(DateTimeZone $timezone): DateTime {}
412412
*/
413413
public function getOffset(): int {}
414414

415-
/** @tentative-return-type */
416-
public function getMicroseconds(): int {}
415+
public function getMicrosecond(): int {}
417416

418417
/**
419418
* @tentative-return-type
@@ -439,8 +438,7 @@ public function setISODate(int $year, int $week, int $dayOfWeek = 1): DateTime {
439438
*/
440439
public function setTimestamp(int $timestamp): DateTime {}
441440

442-
/** @tentative-return-type */
443-
public function setMicroseconds(int $microseconds): static {}
441+
public function setMicrosecond(int $microsecond): static {}
444442

445443
/**
446444
* @tentative-return-type
@@ -510,10 +508,9 @@ public function getOffset(): int {}
510508
public function getTimestamp(): int {}
511509

512510
/**
513-
* @alias DateTime::getMicroseconds
514-
* @tentative-return-type
511+
* @alias DateTime::getMicrosecond
515512
*/
516-
public function getMicroseconds(): int {}
513+
public function getMicrosecond(): int {}
517514

518515
/**
519516
* @tentative-return-type
@@ -545,8 +542,7 @@ public function setISODate(int $year, int $week, int $dayOfWeek = 1): DateTimeIm
545542
/** @tentative-return-type */
546543
public function setTimestamp(int $timestamp): DateTimeImmutable {}
547544

548-
/** @tentative-return-type */
549-
public function setMicroseconds(int $microseconds): static {}
545+
public function setMicrosecond(int $microsecond): static {}
550546

551547
/** @tentative-return-type */
552548
public static function createFromMutable(DateTime $object): static {}

ext/date/php_date_arginfo.h

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)