com php-src: Fix DateTimeImmutable stubs: ext/date/php_date .c ext/date/php_date.stub.php ext/date/php_date _arginfo.h
| From: | Nikita Popov | Date: | Fri, 15 Nov 2019 15:02:26 +0000 |
| Subject: | com php-src: Fix DateTimeImmutable stubs: ext/date/php_date .c ext/date/php_date.stub.php ext/date/php_date _arginfo.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-109269@lists.php.net to get a copy of this message | ||
Commit: 468ecf295d3e15a2b8d0aa3ca6b39bbb29dbffd6
Author: Nikita Popov <nikita.ppv@gmail.com> Fri, 15 Nov 2019 16:02:26 +0100
Parents: 9899fdc4540c2470f2400c7fce71f0d3e879654f
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=468ecf295d3e15a2b8d0aa3ca6b39bbb29dbffd6
Log:
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.
Changed paths:
M ext/date/php_date.c
M ext/date/php_date.stub.php
M ext/date/php_date_arginfo.h
Diff:
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index ed0c438d04f..59f5a5077f2 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -175,8 +175,8 @@ static const zend_function_entry date_funcs_immutable[] = {
PHP_ME(DateTimeImmutable, __construct, arginfo_class_DateTimeImmutable___construct,
ZEND_ACC_PUBLIC)
PHP_ME(DateTime, __wakeup, arginfo_class_DateTimeInterface___wakeup, ZEND_ACC_PUBLIC)
PHP_ME(DateTimeImmutable, __set_state, arginfo_class_DateTimeImmutable___set_state,
ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
- PHP_ME_MAPPING(createFromFormat, date_create_immutable_from_format,
arginfo_date_create_from_format, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
- PHP_ME_MAPPING(getLastErrors, date_get_last_errors, arginfo_date_get_last_errors,
ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+ PHP_ME_MAPPING(createFromFormat, date_create_immutable_from_format,
arginfo_class_DateTimeImmutable_createFromFormat, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+ PHP_ME_MAPPING(getLastErrors, date_get_last_errors,
arginfo_class_DateTimeImmutable_getLastErrors, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_ME_MAPPING(format, date_format, arginfo_class_DateTimeInterface_format,
0)
PHP_ME_MAPPING(getTimezone, date_timezone_get, arginfo_class_DateTimeInterface_getTimezone, 0)
PHP_ME_MAPPING(getOffset, date_offset_get, arginfo_class_DateTimeInterface_getOffset, 0)
diff --git a/ext/date/php_date.stub.php b/ext/date/php_date.stub.php
index 13d301ee9fb...b76f0bd1df7 100644
--- a/ext/date/php_date.stub.php
+++ b/ext/date/php_date.stub.php
@@ -194,6 +194,13 @@ class DateTimeImmutable implements DateTimeInterface {
public static function createFromMutable(DateTime $object);
/** @return DateTimeImmutable|false */
+ public static function createFromFormat(
+ string $format, string $time, ?DateTimeZone $timezone = null);
+
+ /** @return array|false */
+ public static function getLastErrors();
+
+ /** @return DateTimeImmutable|false */
public function modify(string $modify);
/** @return DateTimeImmutable */
diff --git a/ext/date/php_date_arginfo.h b/ext/date/php_date_arginfo.h
index 7f8edb79e96..15c4bd203d3 100644
--- a/ext/date/php_date_arginfo.h
+++ b/ext/date/php_date_arginfo.h
@@ -296,6 +296,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_DateTimeImmutable_createFromMutable, 0, 0,
ZEND_ARG_OBJ_INFO(0, object, DateTime, 0)
ZEND_END_ARG_INFO()
+#define arginfo_class_DateTimeImmutable_createFromFormat arginfo_date_create_from_format
+
+#define arginfo_class_DateTimeImmutable_getLastErrors arginfo_class_DateTimeInterface_getTimezone
+
#define arginfo_class_DateTimeImmutable_modify arginfo_class_DateTime_modify
#define arginfo_class_DateTimeImmutable_add arginfo_class_DateTime_add