Playing around with gen_stub.php and attributes.

This commit is contained in:
michael-grunder
2022-11-17 09:35:40 -08:00
parent 72f8eb2565
commit f41efddc3a
3 changed files with 90 additions and 2 deletions

View File

@@ -6,6 +6,13 @@
* @generate-class-entries
*/
require "Zend/zend_attributes.stub.php";
abstract class RedisMethodType {}
#[\Attribute(\Attribute::TARGET_METHOD)]
class IntrospectionMethod extends MethodType {}
class Redis {
/**
@@ -77,6 +84,7 @@ class Redis {
* @return string The compressed result
*
*/
#[IntrospectionMethod]
public function _compress(string $value): string;
/**

View File

@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 7230a9518fe0e79ae51f6b49d269053535a34199 */
* Stub hash: e201e7296984e2750b15d296173946de4002b71d */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "null")
@@ -1381,6 +1381,16 @@ ZEND_METHOD(Redis, zunion);
ZEND_METHOD(Redis, zunionstore);
static const zend_function_entry class_RedisMethodType_methods[] = {
ZEND_FE_END
};
static const zend_function_entry class_IntrospectionMethod_methods[] = {
ZEND_FE_END
};
static const zend_function_entry class_Redis_methods[] = {
ZEND_ME(Redis, __construct, arginfo_class_Redis___construct, ZEND_ACC_PUBLIC)
ZEND_ME(Redis, __destruct, arginfo_class_Redis___destruct, ZEND_ACC_PUBLIC)
@@ -1637,6 +1647,36 @@ static const zend_function_entry class_RedisException_methods[] = {
ZEND_FE_END
};
static zend_class_entry *register_class_RedisMethodType(void)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "RedisMethodType", class_RedisMethodType_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
class_entry->ce_flags |= ZEND_ACC_ABSTRACT;
return class_entry;
}
static zend_class_entry *register_class_IntrospectionMethod(zend_class_entry *class_entry_MethodType)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "IntrospectionMethod", class_IntrospectionMethod_methods);
class_entry = zend_register_internal_class_ex(&ce, class_entry_MethodType);
#if (PHP_VERSION_ID >= 80200)
zend_string *attribute_name_Attribute_class_IntrospectionMethod = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1);
zend_attribute *attribute_Attribute_class_IntrospectionMethod = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_IntrospectionMethod, 1);
zend_string_release(attribute_name_Attribute_class_IntrospectionMethod);
zval attribute_Attribute_class_IntrospectionMethod_arg0;
ZVAL_LONG(&attribute_Attribute_class_IntrospectionMethod_arg0, ZEND_ATTRIBUTE_TARGET_METHOD);
ZVAL_COPY_VALUE(&attribute_Attribute_class_IntrospectionMethod->args[0].value, &attribute_Attribute_class_IntrospectionMethod_arg0);
#endif
return class_entry;
}
static zend_class_entry *register_class_Redis(void)
{
zend_class_entry ce, *class_entry;

View File

@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 7230a9518fe0e79ae51f6b49d269053535a34199 */
* Stub hash: e201e7296984e2750b15d296173946de4002b71d */
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Redis___construct, 0, 0, 0)
ZEND_ARG_INFO(0, options)
@@ -1222,6 +1222,16 @@ ZEND_METHOD(Redis, zunion);
ZEND_METHOD(Redis, zunionstore);
static const zend_function_entry class_RedisMethodType_methods[] = {
ZEND_FE_END
};
static const zend_function_entry class_IntrospectionMethod_methods[] = {
ZEND_FE_END
};
static const zend_function_entry class_Redis_methods[] = {
ZEND_ME(Redis, __construct, arginfo_class_Redis___construct, ZEND_ACC_PUBLIC)
ZEND_ME(Redis, __destruct, arginfo_class_Redis___destruct, ZEND_ACC_PUBLIC)
@@ -1478,6 +1488,36 @@ static const zend_function_entry class_RedisException_methods[] = {
ZEND_FE_END
};
static zend_class_entry *register_class_RedisMethodType(void)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "RedisMethodType", class_RedisMethodType_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
class_entry->ce_flags |= ZEND_ACC_ABSTRACT;
return class_entry;
}
static zend_class_entry *register_class_IntrospectionMethod(zend_class_entry *class_entry_MethodType)
{
zend_class_entry ce, *class_entry;
INIT_CLASS_ENTRY(ce, "IntrospectionMethod", class_IntrospectionMethod_methods);
class_entry = zend_register_internal_class_ex(&ce, class_entry_MethodType);
#if (PHP_VERSION_ID >= 80200)
zend_string *attribute_name_Attribute_class_IntrospectionMethod = zend_string_init_interned("Attribute", sizeof("Attribute") - 1, 1);
zend_attribute *attribute_Attribute_class_IntrospectionMethod = zend_add_class_attribute(class_entry, attribute_name_Attribute_class_IntrospectionMethod, 1);
zend_string_release(attribute_name_Attribute_class_IntrospectionMethod);
zval attribute_Attribute_class_IntrospectionMethod_arg0;
ZVAL_LONG(&attribute_Attribute_class_IntrospectionMethod_arg0, ZEND_ATTRIBUTE_TARGET_METHOD);
ZVAL_COPY_VALUE(&attribute_Attribute_class_IntrospectionMethod->args[0].value, &attribute_Attribute_class_IntrospectionMethod_arg0);
#endif
return class_entry;
}
static zend_class_entry *register_class_Redis(void)
{
zend_class_entry ce, *class_entry;