Skip to content

Commit 498f0b2

Browse files
authored
Gen class entries in stubs (#490)
1 parent 0f6a27e commit 498f0b2

36 files changed

+392
-74
lines changed

metadata.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,7 @@ PHP_METHOD(RdKafka_Metadata, getTopics)
204204

205205
void kafka_metadata_minit(INIT_FUNC_ARGS)
206206
{
207-
zend_class_entry tmpce;
208-
209-
INIT_NS_CLASS_ENTRY(tmpce, "RdKafka", "Metadata", class_RdKafka_Metadata_methods);
210-
ce = zend_register_internal_class(&tmpce);
207+
ce = register_class_RdKafka_Metadata();
211208
ce->create_object = kafka_metadata_new;
212209

213210
handlers = kafka_default_object_handlers;

metadata.stub.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
/**
4+
* @generate-class-entries
45
* @generate-function-entries
56
* @generate-legacy-arginfo
67
*/

metadata_arginfo.h

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 218d2b82c291fccf0934e9488ee6aebae2c032b4 */
2+
* Stub hash: 7bdf537cb18915955d6c3f1d4775dcc9fc43eb4a */
33

44
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_RdKafka_Metadata_getOrigBrokerId, 0, 0, IS_LONG, 0)
55
ZEND_END_ARG_INFO()
@@ -26,3 +26,13 @@ static const zend_function_entry class_RdKafka_Metadata_methods[] = {
2626
ZEND_ME(RdKafka_Metadata, getTopics, arginfo_class_RdKafka_Metadata_getTopics, ZEND_ACC_PUBLIC)
2727
ZEND_FE_END
2828
};
29+
30+
static zend_class_entry *register_class_RdKafka_Metadata(void)
31+
{
32+
zend_class_entry ce, *class_entry;
33+
34+
INIT_NS_CLASS_ENTRY(ce, "RdKafka", "Metadata", class_RdKafka_Metadata_methods);
35+
class_entry = zend_register_internal_class_ex(&ce, NULL);
36+
37+
return class_entry;
38+
}

metadata_broker.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,7 @@ PHP_METHOD(RdKafka_Metadata_Broker, getPort)
165165

166166
void kafka_metadata_broker_minit(INIT_FUNC_ARGS)
167167
{
168-
zend_class_entry tmpce;
169-
170-
INIT_NS_CLASS_ENTRY(tmpce, "RdKafka", "Metadata\\Broker", class_RdKafka_Metadata_Broker_methods);
171-
ce = zend_register_internal_class(&tmpce);
168+
ce = register_class_RdKafka_Metadata_Broker();
172169
ce->create_object = create_object;
173170

174171
handlers = kafka_default_object_handlers;

metadata_broker.stub.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
/**
4+
* @generate-class-entries
45
* @generate-function-entries
56
* @generate-legacy-arginfo
67
*/

metadata_broker_arginfo.h

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: f6051d268841dfabdd3acae263688ea4d60b5201 */
2+
* Stub hash: 53fa93c8908858d59ab75b39a77efdea9e843675 */
33

44
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_RdKafka_Metadata_Broker_getId, 0, 0, IS_LONG, 0)
55
ZEND_END_ARG_INFO()
@@ -21,3 +21,13 @@ static const zend_function_entry class_RdKafka_Metadata_Broker_methods[] = {
2121
ZEND_ME(RdKafka_Metadata_Broker, getPort, arginfo_class_RdKafka_Metadata_Broker_getPort, ZEND_ACC_PUBLIC)
2222
ZEND_FE_END
2323
};
24+
25+
static zend_class_entry *register_class_RdKafka_Metadata_Broker(void)
26+
{
27+
zend_class_entry ce, *class_entry;
28+
29+
INIT_NS_CLASS_ENTRY(ce, "RdKafka\\Metadata", "Broker", class_RdKafka_Metadata_Broker_methods);
30+
class_entry = zend_register_internal_class_ex(&ce, NULL);
31+
32+
return class_entry;
33+
}

metadata_broker_legacy_arginfo.h

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: f6051d268841dfabdd3acae263688ea4d60b5201 */
2+
* Stub hash: 53fa93c8908858d59ab75b39a77efdea9e843675 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RdKafka_Metadata_Broker_getId, 0, 0, 0)
55
ZEND_END_ARG_INFO()
@@ -20,3 +20,13 @@ static const zend_function_entry class_RdKafka_Metadata_Broker_methods[] = {
2020
ZEND_ME(RdKafka_Metadata_Broker, getPort, arginfo_class_RdKafka_Metadata_Broker_getPort, ZEND_ACC_PUBLIC)
2121
ZEND_FE_END
2222
};
23+
24+
static zend_class_entry *register_class_RdKafka_Metadata_Broker(void)
25+
{
26+
zend_class_entry ce, *class_entry;
27+
28+
INIT_NS_CLASS_ENTRY(ce, "RdKafka\\Metadata", "Broker", class_RdKafka_Metadata_Broker_methods);
29+
class_entry = zend_register_internal_class_ex(&ce, NULL);
30+
31+
return class_entry;
32+
}

metadata_collection.c

+3-7
Original file line numberDiff line numberDiff line change
@@ -241,16 +241,12 @@ PHP_METHOD(RdKafka_Metadata_Collection, valid)
241241

242242
void kafka_metadata_collection_minit(INIT_FUNC_ARGS)
243243
{
244-
zend_class_entry tmpce;
245-
246-
INIT_NS_CLASS_ENTRY(tmpce, "RdKafka\\Metadata", "Collection", class_RdKafka_Metadata_Collection_methods);
247-
ce = zend_register_internal_class(&tmpce);
248-
ce->create_object = create_object;
249244
#if PHP_VERSION_ID < 80100
250-
zend_class_implements(ce, 2, spl_ce_Countable, spl_ce_Iterator);
245+
ce = register_class_RdKafka_Metadata_Collection(spl_ce_Countable, spl_ce_Iterator);
251246
#else
252-
zend_class_implements(ce, 2, zend_ce_countable, zend_ce_iterator);
247+
ce = register_class_RdKafka_Metadata_Collection(zend_ce_countable, zend_ce_iterator);
253248
#endif
249+
ce->create_object = create_object;
254250

255251
handlers = kafka_default_object_handlers;
256252
handlers.get_debug_info = get_debug_info;

metadata_collection.stub.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<?php
22

33
/**
4+
* @generate-class-entries
45
* @generate-function-entries
56
* @generate-legacy-arginfo
67
*/
78

89
namespace RdKafka\Metadata;
910

10-
class Collection
11+
class Collection implements \Countable, \Iterator
1112
{
1213
/** @tentative-return-type */
1314
public function count(): int {}

metadata_collection_arginfo.h

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 03254419e10af3447777114463b9a9e64413545c */
2+
* Stub hash: a84f8bd542d46b72179ff6aa0d9d17bed530a2de */
33

44
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_RdKafka_Metadata_Collection_count, 0, 0, IS_LONG, 0)
55
ZEND_END_ARG_INFO()
@@ -35,3 +35,14 @@ static const zend_function_entry class_RdKafka_Metadata_Collection_methods[] = {
3535
ZEND_ME(RdKafka_Metadata_Collection, valid, arginfo_class_RdKafka_Metadata_Collection_valid, ZEND_ACC_PUBLIC)
3636
ZEND_FE_END
3737
};
38+
39+
static zend_class_entry *register_class_RdKafka_Metadata_Collection(zend_class_entry *class_entry_Countable, zend_class_entry *class_entry_Iterator)
40+
{
41+
zend_class_entry ce, *class_entry;
42+
43+
INIT_NS_CLASS_ENTRY(ce, "RdKafka\\Metadata", "Collection", class_RdKafka_Metadata_Collection_methods);
44+
class_entry = zend_register_internal_class_ex(&ce, NULL);
45+
zend_class_implements(class_entry, 2, class_entry_Countable, class_entry_Iterator);
46+
47+
return class_entry;
48+
}

metadata_collection_legacy_arginfo.h

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 03254419e10af3447777114463b9a9e64413545c */
2+
* Stub hash: a84f8bd542d46b72179ff6aa0d9d17bed530a2de */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RdKafka_Metadata_Collection_count, 0, 0, 0)
55
ZEND_END_ARG_INFO()
@@ -32,3 +32,14 @@ static const zend_function_entry class_RdKafka_Metadata_Collection_methods[] = {
3232
ZEND_ME(RdKafka_Metadata_Collection, valid, arginfo_class_RdKafka_Metadata_Collection_valid, ZEND_ACC_PUBLIC)
3333
ZEND_FE_END
3434
};
35+
36+
static zend_class_entry *register_class_RdKafka_Metadata_Collection(zend_class_entry *class_entry_Countable, zend_class_entry *class_entry_Iterator)
37+
{
38+
zend_class_entry ce, *class_entry;
39+
40+
INIT_NS_CLASS_ENTRY(ce, "RdKafka\\Metadata", "Collection", class_RdKafka_Metadata_Collection_methods);
41+
class_entry = zend_register_internal_class_ex(&ce, NULL);
42+
zend_class_implements(class_entry, 2, class_entry_Countable, class_entry_Iterator);
43+
44+
return class_entry;
45+
}

metadata_legacy_arginfo.h

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 218d2b82c291fccf0934e9488ee6aebae2c032b4 */
2+
* Stub hash: 7bdf537cb18915955d6c3f1d4775dcc9fc43eb4a */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RdKafka_Metadata_getOrigBrokerId, 0, 0, 0)
55
ZEND_END_ARG_INFO()
@@ -24,3 +24,13 @@ static const zend_function_entry class_RdKafka_Metadata_methods[] = {
2424
ZEND_ME(RdKafka_Metadata, getTopics, arginfo_class_RdKafka_Metadata_getTopics, ZEND_ACC_PUBLIC)
2525
ZEND_FE_END
2626
};
27+
28+
static zend_class_entry *register_class_RdKafka_Metadata(void)
29+
{
30+
zend_class_entry ce, *class_entry;
31+
32+
INIT_NS_CLASS_ENTRY(ce, "RdKafka", "Metadata", class_RdKafka_Metadata_methods);
33+
class_entry = zend_register_internal_class_ex(&ce, NULL);
34+
35+
return class_entry;
36+
}

metadata_partition.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,7 @@ PHP_METHOD(RdKafka_Metadata_Partition, getIsrs)
210210

211211
void kafka_metadata_partition_minit(INIT_FUNC_ARGS)
212212
{
213-
zend_class_entry tmpce;
214-
215-
INIT_NS_CLASS_ENTRY(tmpce, "RdKafka", "Metadata\\Partition", class_RdKafka_Metadata_Partition_methods);
216-
ce = zend_register_internal_class(&tmpce);
213+
ce = register_class_RdKafka_Metadata_Partition();
217214
ce->create_object = create_object;
218215

219216
handlers = kafka_default_object_handlers;

metadata_partition.stub.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
/**
4+
* @generate-class-entries
45
* @generate-function-entries
56
* @generate-legacy-arginfo
67
*/

metadata_partition_arginfo.h

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: f037447a0343c97281f5f1d0578154ebaafcb647 */
2+
* Stub hash: 4c02c5ac3a6240ab8cbc90451bdc54a3de2c2d2f */
33

44
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_RdKafka_Metadata_Partition_getId, 0, 0, IS_LONG, 0)
55
ZEND_END_ARG_INFO()
@@ -29,3 +29,13 @@ static const zend_function_entry class_RdKafka_Metadata_Partition_methods[] = {
2929
ZEND_ME(RdKafka_Metadata_Partition, getIsrs, arginfo_class_RdKafka_Metadata_Partition_getIsrs, ZEND_ACC_PUBLIC)
3030
ZEND_FE_END
3131
};
32+
33+
static zend_class_entry *register_class_RdKafka_Metadata_Partition(void)
34+
{
35+
zend_class_entry ce, *class_entry;
36+
37+
INIT_NS_CLASS_ENTRY(ce, "RdKafka\\Metadata", "Partition", class_RdKafka_Metadata_Partition_methods);
38+
class_entry = zend_register_internal_class_ex(&ce, NULL);
39+
40+
return class_entry;
41+
}

metadata_partition_legacy_arginfo.h

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: f037447a0343c97281f5f1d0578154ebaafcb647 */
2+
* Stub hash: 4c02c5ac3a6240ab8cbc90451bdc54a3de2c2d2f */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RdKafka_Metadata_Partition_getId, 0, 0, 0)
55
ZEND_END_ARG_INFO()
@@ -28,3 +28,13 @@ static const zend_function_entry class_RdKafka_Metadata_Partition_methods[] = {
2828
ZEND_ME(RdKafka_Metadata_Partition, getIsrs, arginfo_class_RdKafka_Metadata_Partition_getIsrs, ZEND_ACC_PUBLIC)
2929
ZEND_FE_END
3030
};
31+
32+
static zend_class_entry *register_class_RdKafka_Metadata_Partition(void)
33+
{
34+
zend_class_entry ce, *class_entry;
35+
36+
INIT_NS_CLASS_ENTRY(ce, "RdKafka\\Metadata", "Partition", class_RdKafka_Metadata_Partition_methods);
37+
class_entry = zend_register_internal_class_ex(&ce, NULL);
38+
39+
return class_entry;
40+
}

metadata_topic.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,7 @@ PHP_METHOD(RdKafka_Metadata_Topic, getPartitions)
178178

179179
void kafka_metadata_topic_minit(INIT_FUNC_ARGS)
180180
{
181-
zend_class_entry tmpce;
182-
183-
INIT_NS_CLASS_ENTRY(tmpce, "RdKafka\\Metadata", "Topic", class_RdKafka_Metadata_Topic_methods);
184-
ce = zend_register_internal_class(&tmpce);
181+
ce = register_class_RdKafka_Metadata_Topic();
185182
ce->create_object = create_object;
186183

187184
handlers = kafka_default_object_handlers;

metadata_topic.stub.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
/**
4+
* @generate-class-entries
45
* @generate-function-entries
56
* @generate-legacy-arginfo
67
*/

metadata_topic_arginfo.h

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: d2f3c47b432437ec9731dcade240042719446291 */
2+
* Stub hash: 90ddb49b26a651772f9b71a1233435f2a502af6d */
33

44
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_RdKafka_Metadata_Topic_getTopic, 0, 0, IS_STRING, 0)
55
ZEND_END_ARG_INFO()
@@ -22,3 +22,13 @@ static const zend_function_entry class_RdKafka_Metadata_Topic_methods[] = {
2222
ZEND_ME(RdKafka_Metadata_Topic, getPartitions, arginfo_class_RdKafka_Metadata_Topic_getPartitions, ZEND_ACC_PUBLIC)
2323
ZEND_FE_END
2424
};
25+
26+
static zend_class_entry *register_class_RdKafka_Metadata_Topic(void)
27+
{
28+
zend_class_entry ce, *class_entry;
29+
30+
INIT_NS_CLASS_ENTRY(ce, "RdKafka\\Metadata", "Topic", class_RdKafka_Metadata_Topic_methods);
31+
class_entry = zend_register_internal_class_ex(&ce, NULL);
32+
33+
return class_entry;
34+
}

metadata_topic_legacy_arginfo.h

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: d2f3c47b432437ec9731dcade240042719446291 */
2+
* Stub hash: 90ddb49b26a651772f9b71a1233435f2a502af6d */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RdKafka_Metadata_Topic_getTopic, 0, 0, 0)
55
ZEND_END_ARG_INFO()
@@ -20,3 +20,13 @@ static const zend_function_entry class_RdKafka_Metadata_Topic_methods[] = {
2020
ZEND_ME(RdKafka_Metadata_Topic, getPartitions, arginfo_class_RdKafka_Metadata_Topic_getPartitions, ZEND_ACC_PUBLIC)
2121
ZEND_FE_END
2222
};
23+
24+
static zend_class_entry *register_class_RdKafka_Metadata_Topic(void)
25+
{
26+
zend_class_entry ce, *class_entry;
27+
28+
INIT_NS_CLASS_ENTRY(ce, "RdKafka\\Metadata", "Topic", class_RdKafka_Metadata_Topic_methods);
29+
class_entry = zend_register_internal_class_ex(&ce, NULL);
30+
31+
return class_entry;
32+
}

queue.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,10 @@ PHP_METHOD(RdKafka_Queue, consume)
120120

121121
void kafka_queue_minit(INIT_FUNC_ARGS) { /* {{{ */
122122

123-
zend_class_entry ce;
124-
125123
handlers = kafka_default_object_handlers;
126124
handlers.free_obj = kafka_queue_free;
127125
handlers.offset = XtOffsetOf(kafka_queue_object, std);
128126

129-
INIT_NS_CLASS_ENTRY(ce, "RdKafka", "Queue", class_RdKafka_Queue_methods);
130-
ce_kafka_queue = zend_register_internal_class(&ce);
127+
ce_kafka_queue = register_class_RdKafka_Queue();
131128
ce_kafka_queue->create_object = kafka_queue_new;
132129
} /* }}} */

queue.stub.php

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
/**
4+
* @generate-class-entries
45
* @generate-function-entries
56
* @generate-legacy-arginfo
67
*/

queue_arginfo.h

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 8a39c31916ef5bb148a192245a3f0c7c6ce2dfc3 */
2+
* Stub hash: 9e80d48bb60ede4003fffcfe0da09ac0e5c2f4d1 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RdKafka_Queue___construct, 0, 0, 0)
55
ZEND_END_ARG_INFO()
@@ -18,3 +18,13 @@ static const zend_function_entry class_RdKafka_Queue_methods[] = {
1818
ZEND_ME(RdKafka_Queue, consume, arginfo_class_RdKafka_Queue_consume, ZEND_ACC_PUBLIC)
1919
ZEND_FE_END
2020
};
21+
22+
static zend_class_entry *register_class_RdKafka_Queue(void)
23+
{
24+
zend_class_entry ce, *class_entry;
25+
26+
INIT_NS_CLASS_ENTRY(ce, "RdKafka", "Queue", class_RdKafka_Queue_methods);
27+
class_entry = zend_register_internal_class_ex(&ce, NULL);
28+
29+
return class_entry;
30+
}

queue_legacy_arginfo.h

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 8a39c31916ef5bb148a192245a3f0c7c6ce2dfc3 */
2+
* Stub hash: 9e80d48bb60ede4003fffcfe0da09ac0e5c2f4d1 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_RdKafka_Queue___construct, 0, 0, 0)
55
ZEND_END_ARG_INFO()
@@ -18,3 +18,13 @@ static const zend_function_entry class_RdKafka_Queue_methods[] = {
1818
ZEND_ME(RdKafka_Queue, consume, arginfo_class_RdKafka_Queue_consume, ZEND_ACC_PUBLIC)
1919
ZEND_FE_END
2020
};
21+
22+
static zend_class_entry *register_class_RdKafka_Queue(void)
23+
{
24+
zend_class_entry ce, *class_entry;
25+
26+
INIT_NS_CLASS_ENTRY(ce, "RdKafka", "Queue", class_RdKafka_Queue_methods);
27+
class_entry = zend_register_internal_class_ex(&ce, NULL);
28+
29+
return class_entry;
30+
}

0 commit comments

Comments
 (0)