diff --git a/ext/date/php_date.stub.php b/ext/date/php_date.stub.php index da2182dfb6fa..a0f3d895bbb9 100644 --- a/ext/date/php_date.stub.php +++ b/ext/date/php_date.stub.php @@ -349,8 +349,8 @@ public static function __set_state(array $array): DateTime {} /** @tentative-return-type */ public static function createFromImmutable(DateTimeImmutable $object): static {} - /** @return static */ - public static function createFromInterface(DateTimeInterface $object): DateTime {} // TODO return type should be static + /** @tentative-return-type */ + public static function createFromInterface(DateTimeInterface $object): static {} /** * @tentative-return-type @@ -462,7 +462,7 @@ public function __unserialize(array $data): void {} public function __wakeup(): void {} /** @tentative-return-type */ - public static function __set_state(array $array): DateTimeImmutable {} + public static function __set_state(array $array): static {} /** * @tentative-return-type @@ -517,35 +517,35 @@ public function diff(DateTimeInterface $targetObject, bool $absolute = false): D /** @tentative-return-type */ #[\NoDiscard(message: "as DateTimeImmutable::modify() does not modify the object itself")] - public function modify(string $modifier): DateTimeImmutable {} + public function modify(string $modifier): static {} /** @tentative-return-type */ #[\NoDiscard(message: "as DateTimeImmutable::add() does not modify the object itself")] - public function add(DateInterval $interval): DateTimeImmutable {} + public function add(DateInterval $interval): static {} /** @tentative-return-type */ #[\NoDiscard(message: "as DateTimeImmutable::sub() does not modify the object itself")] - public function sub(DateInterval $interval): DateTimeImmutable {} + public function sub(DateInterval $interval): static {} /** @tentative-return-type */ #[\NoDiscard(message: "as DateTimeImmutable::setTimezone() does not modify the object itself")] - public function setTimezone(DateTimeZone $timezone): DateTimeImmutable {} + public function setTimezone(DateTimeZone $timezone): static {} /** @tentative-return-type */ #[\NoDiscard(message: "as DateTimeImmutable::setTime() does not modify the object itself")] - public function setTime(int $hour, int $minute, int $second = 0, int $microsecond = 0): DateTimeImmutable {} + public function setTime(int $hour, int $minute, int $second = 0, int $microsecond = 0): static {} /** @tentative-return-type */ #[\NoDiscard(message: "as DateTimeImmutable::setDate() does not modify the object itself")] - public function setDate(int $year, int $month, int $day): DateTimeImmutable {} + public function setDate(int $year, int $month, int $day): static {} /** @tentative-return-type */ #[\NoDiscard(message: "as DateTimeImmutable::setISODate() does not modify the object itself")] - public function setISODate(int $year, int $week, int $dayOfWeek = 1): DateTimeImmutable {} + public function setISODate(int $year, int $week, int $dayOfWeek = 1): static {} /** @tentative-return-type */ #[\NoDiscard(message: "as DateTimeImmutable::setTimestamp() does not modify the object itself")] - public function setTimestamp(int $timestamp): DateTimeImmutable {} + public function setTimestamp(int $timestamp): static {} #[\NoDiscard(message: "as DateTimeImmutable::setMicrosecond() does not modify the object itself")] public function setMicrosecond(int $microsecond): static {} @@ -553,8 +553,8 @@ public function setMicrosecond(int $microsecond): static {} /** @tentative-return-type */ public static function createFromMutable(DateTime $object): static {} - /** @return static */ - public static function createFromInterface(DateTimeInterface $object): DateTimeImmutable {} // TODO return type should be static + /** @tentative-return-type */ + public static function createFromInterface(DateTimeInterface $object): static {} } class DateTimeZone @@ -639,7 +639,7 @@ public function __unserialize(array $data): void {} public function __wakeup(): void {} /** @tentative-return-type */ - public static function __set_state(array $array): DateTimeZone {} + public static function __set_state(array $array): static {} } class DateInterval @@ -649,7 +649,7 @@ public function __construct(string $duration) {} /** * @tentative-return-type */ - public static function createFromDateString(string $datetime): DateInterval {} + public static function createFromDateString(string $datetime): static {} /** * @tentative-return-type @@ -666,7 +666,7 @@ public function __unserialize(array $data): void; public function __wakeup(): void {} /** @tentative-return-type */ - public static function __set_state(array $array): DateInterval {} + public static function __set_state(array $array): static {} } class DatePeriod implements IteratorAggregate @@ -743,7 +743,7 @@ public function __unserialize(array $data): void; public function __wakeup(): void {} /** @tentative-return-type */ - public static function __set_state(array $array): DatePeriod {} + public static function __set_state(array $array): static {} public function getIterator(): Iterator {} } diff --git a/ext/date/php_date_arginfo.h b/ext/date/php_date_arginfo.h index db2b4d5ea9e1..c418cc3d94c4 100644 --- a/ext/date/php_date_arginfo.h +++ b/ext/date/php_date_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit php_date.stub.php instead. - * Stub hash: 8556e1b5f05ae9f78200f05f01d9f8e815cba49d */ + * Stub hash: 0e01f68589a71eae2f789ef6de330ac27724ba47 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_strtotime, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, datetime, IS_STRING, 0) @@ -272,7 +272,7 @@ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateTime_createF ZEND_ARG_OBJ_INFO(0, object, DateTimeImmutable, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_DateTime_createFromInterface, 0, 1, DateTime, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateTime_createFromInterface, 0, 1, IS_STATIC, 0) ZEND_ARG_OBJ_INFO(0, object, DateTimeInterface, 0) ZEND_END_ARG_INFO() @@ -350,7 +350,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_DateTimeImmutable___wakeup arginfo_class_DateTimeInterface___wakeup -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeImmutable___set_state, 0, 1, DateTimeImmutable, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateTimeImmutable___set_state, 0, 1, IS_STATIC, 0) ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) ZEND_END_ARG_INFO() @@ -376,40 +376,40 @@ ZEND_END_ARG_INFO() #define arginfo_class_DateTimeImmutable_diff arginfo_class_DateTimeInterface_diff -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeImmutable_modify, 0, 1, DateTimeImmutable, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateTimeImmutable_modify, 0, 1, IS_STATIC, 0) ZEND_ARG_TYPE_INFO(0, modifier, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeImmutable_add, 0, 1, DateTimeImmutable, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateTimeImmutable_add, 0, 1, IS_STATIC, 0) ZEND_ARG_OBJ_INFO(0, interval, DateInterval, 0) ZEND_END_ARG_INFO() #define arginfo_class_DateTimeImmutable_sub arginfo_class_DateTimeImmutable_add -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeImmutable_setTimezone, 0, 1, DateTimeImmutable, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateTimeImmutable_setTimezone, 0, 1, IS_STATIC, 0) ZEND_ARG_OBJ_INFO(0, timezone, DateTimeZone, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeImmutable_setTime, 0, 2, DateTimeImmutable, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateTimeImmutable_setTime, 0, 2, IS_STATIC, 0) ZEND_ARG_TYPE_INFO(0, hour, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, minute, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, second, IS_LONG, 0, "0") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, microsecond, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeImmutable_setDate, 0, 3, DateTimeImmutable, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateTimeImmutable_setDate, 0, 3, IS_STATIC, 0) ZEND_ARG_TYPE_INFO(0, year, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, month, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, day, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeImmutable_setISODate, 0, 2, DateTimeImmutable, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateTimeImmutable_setISODate, 0, 2, IS_STATIC, 0) ZEND_ARG_TYPE_INFO(0, year, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, week, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, dayOfWeek, IS_LONG, 0, "1") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeImmutable_setTimestamp, 0, 1, DateTimeImmutable, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateTimeImmutable_setTimestamp, 0, 1, IS_STATIC, 0) ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -419,9 +419,7 @@ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateTimeImmutabl ZEND_ARG_OBJ_INFO(0, object, DateTime, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeImmutable_createFromInterface, 0, 1, DateTimeImmutable, 0) - ZEND_ARG_OBJ_INFO(0, object, DateTimeInterface, 0) -ZEND_END_ARG_INFO() +#define arginfo_class_DateTimeImmutable_createFromInterface arginfo_class_DateTime_createFromInterface ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTimeZone___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, timezone, IS_STRING, 0) @@ -455,15 +453,13 @@ ZEND_END_ARG_INFO() #define arginfo_class_DateTimeZone___wakeup arginfo_class_DateTimeInterface___wakeup -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateTimeZone___set_state, 0, 1, DateTimeZone, 0) - ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) -ZEND_END_ARG_INFO() +#define arginfo_class_DateTimeZone___set_state arginfo_class_DateTimeImmutable___set_state ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateInterval___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, duration, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateInterval_createFromDateString, 0, 1, DateInterval, 0) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_DateInterval_createFromDateString, 0, 1, IS_STATIC, 0) ZEND_ARG_TYPE_INFO(0, datetime, IS_STRING, 0) ZEND_END_ARG_INFO() @@ -475,9 +471,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_DateInterval___wakeup arginfo_class_DateTimeInterface___wakeup -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DateInterval___set_state, 0, 1, DateInterval, 0) - ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) -ZEND_END_ARG_INFO() +#define arginfo_class_DateInterval___set_state arginfo_class_DateTimeImmutable___set_state ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_DatePeriod_createFromISO8601String, 0, 1, IS_STATIC, 0) ZEND_ARG_TYPE_INFO(0, specification, IS_STRING, 0) @@ -509,9 +503,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_DatePeriod___wakeup arginfo_class_DateTimeInterface___wakeup -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_DatePeriod___set_state, 0, 1, DatePeriod, 0) - ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) -ZEND_END_ARG_INFO() +#define arginfo_class_DatePeriod___set_state arginfo_class_DateTimeImmutable___set_state ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_DatePeriod_getIterator, 0, 0, Iterator, 0) ZEND_END_ARG_INFO()