com php-src: Add stubs for WeakReference: Zend/zend_weakrefs .c Zend/zend_weakrefs.stub.php Zend/zend_weakrefs _arginfo.h
| From: | Nikita Popov | Date: | Thu, 31 Oct 2019 11:17:04 +0000 |
| Subject: | com php-src: Add stubs for WeakReference: Zend/zend_weakrefs .c Zend/zend_weakrefs.stub.php Zend/zend_weakrefs _arginfo.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-109150@lists.php.net to get a copy of this message | ||
Commit: 2f8b7668386a7c4ede409e6ab7d4d93ce9316def
Author: Nikita Popov <nikita.ppv@gmail.com> Thu, 31 Oct 2019 12:17:04 +0100
Parents: 1517bc4426d5da5a7c1b151ff1fbc5b2bdb2b9b9
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2f8b7668386a7c4ede409e6ab7d4d93ce9316def
Log:
Add stubs for WeakReference
Changed paths:
M Zend/zend_weakrefs.c
A Zend/zend_weakrefs.stub.php
A Zend/zend_weakrefs_arginfo.h
Diff:
diff --git a/Zend/zend_weakrefs.c b/Zend/zend_weakrefs.c
index aae1998d6ca..0d6b9345f68 100644
--- a/Zend/zend_weakrefs.c
+++ b/Zend/zend_weakrefs.c
@@ -18,6 +18,7 @@
#include "zend_interfaces.h"
#include "zend_objects_API.h"
#include "zend_weakrefs.h"
+#include "zend_weakrefs_arginfo.h"
typedef struct _zend_weakref {
zend_object *referent;
@@ -140,13 +141,6 @@ static ZEND_COLD void zend_weakref_no_unset(zend_object *object, zend_string
*me
zend_weakref_unsupported("properties");
}
-ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(zend_weakref_create_arginfo, 0, 1, WeakReference, 0)
- ZEND_ARG_TYPE_INFO(0, referent, IS_OBJECT, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(zend_weakref_get_arginfo, 0, 0, IS_OBJECT, 1)
-ZEND_END_ARG_INFO()
-
ZEND_COLD ZEND_METHOD(WeakReference, __construct)
{
zend_throw_error(NULL,
@@ -178,9 +172,9 @@ ZEND_METHOD(WeakReference, get)
}
static const zend_function_entry zend_weakref_methods[] = {
- ZEND_ME(WeakReference, __construct, NULL, ZEND_ACC_PUBLIC)
- ZEND_ME(WeakReference, create, zend_weakref_create_arginfo, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
- ZEND_ME(WeakReference, get, zend_weakref_get_arginfo, ZEND_ACC_PUBLIC)
+ ZEND_ME(WeakReference, __construct, arginfo_class_WeakReference___construct, ZEND_ACC_PUBLIC)
+ ZEND_ME(WeakReference, create, arginfo_class_WeakReference_create,
ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+ ZEND_ME(WeakReference, get, arginfo_class_WeakReference_get, ZEND_ACC_PUBLIC)
ZEND_FE_END
};
diff --git a/Zend/zend_weakrefs.stub.php b/Zend/zend_weakrefs.stub.php
new file mode 100644
index 00000000000..52ae81c7b8a
--- /dev/null
+++ b/Zend/zend_weakrefs.stub.php
@@ -0,0 +1,9 @@
+<?php
+
+final class WeakReference {
+ public function __construct();
+
+ public static function create(): WeakReference;
+
+ public function get(): ?object;
+}
diff --git a/Zend/zend_weakrefs_arginfo.h b/Zend/zend_weakrefs_arginfo.h
new file mode 100644
index 00000000000..abcd0c8d99a
--- /dev/null
+++ b/Zend/zend_weakrefs_arginfo.h
@@ -0,0 +1,10 @@
+/* This is a generated file, edit the .stub.php file instead. */
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_WeakReference___construct, 0, 0, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_WeakReference_create, 0, 0, WeakReference, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_WeakReference_get, 0, 0, IS_OBJECT, 1)
+ZEND_END_ARG_INFO()