Skip to content

Commit 468ecf2

Browse files
committed
Fix DateTimeImmutable stubs
These were referencing the arginfo from the functions, instead of the methods, which isn't right, as the functions have return types.
1 parent 9899fdc commit 468ecf2

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

ext/date/php_date.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ static const zend_function_entry date_funcs_immutable[] = {
175175
PHP_ME(DateTimeImmutable, __construct, arginfo_class_DateTimeImmutable___construct, ZEND_ACC_PUBLIC)
176176
PHP_ME(DateTime, __wakeup, arginfo_class_DateTimeInterface___wakeup, ZEND_ACC_PUBLIC)
177177
PHP_ME(DateTimeImmutable, __set_state, arginfo_class_DateTimeImmutable___set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
178-
PHP_ME_MAPPING(createFromFormat, date_create_immutable_from_format, arginfo_date_create_from_format, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
179-
PHP_ME_MAPPING(getLastErrors, date_get_last_errors, arginfo_date_get_last_errors, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
178+
PHP_ME_MAPPING(createFromFormat, date_create_immutable_from_format, arginfo_class_DateTimeImmutable_createFromFormat, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
179+
PHP_ME_MAPPING(getLastErrors, date_get_last_errors, arginfo_class_DateTimeImmutable_getLastErrors, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
180180
PHP_ME_MAPPING(format, date_format, arginfo_class_DateTimeInterface_format, 0)
181181
PHP_ME_MAPPING(getTimezone, date_timezone_get, arginfo_class_DateTimeInterface_getTimezone, 0)
182182
PHP_ME_MAPPING(getOffset, date_offset_get, arginfo_class_DateTimeInterface_getOffset, 0)

ext/date/php_date.stub.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,13 @@ public static function __set_state(array $array);
193193
/** @return DateTimeImmutable */
194194
public static function createFromMutable(DateTime $object);
195195

196+
/** @return DateTimeImmutable|false */
197+
public static function createFromFormat(
198+
string $format, string $time, ?DateTimeZone $timezone = null);
199+
200+
/** @return array|false */
201+
public static function getLastErrors();
202+
196203
/** @return DateTimeImmutable|false */
197204
public function modify(string $modify);
198205

ext/date/php_date_arginfo.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTimeImmutable_createFromMutable, 0, 0,
296296
ZEND_ARG_OBJ_INFO(0, object, DateTime, 0)
297297
ZEND_END_ARG_INFO()
298298

299+
#define arginfo_class_DateTimeImmutable_createFromFormat arginfo_date_create_from_format
300+
301+
#define arginfo_class_DateTimeImmutable_getLastErrors arginfo_class_DateTimeInterface_getTimezone
302+
299303
#define arginfo_class_DateTimeImmutable_modify arginfo_class_DateTime_modify
300304

301305
#define arginfo_class_DateTimeImmutable_add arginfo_class_DateTime_add

0 commit comments

Comments
 (0)