summaryrefslogtreecommitdiffstats
path: root/rdkafka-php81.patch
blob: 18c2329d4dfb98ff3f40f50ddde7e6b6f22e83f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
From b3bfa61ef33285b82e785e8f8b0946801ebcce84 Mon Sep 17 00:00:00 2001
From: Nick <nickjobszh@gmail.com>
Date: Fri, 2 Jul 2021 11:40:44 +0200
Subject: [PATCH] replace deprecated interfaces (#460)

* replace deprecated interfaces

* fix for 7.0
---
 metadata_collection.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/metadata_collection.c b/metadata_collection.c
index af986ff..2d273f6 100644
--- a/metadata_collection.c
+++ b/metadata_collection.c
@@ -275,7 +275,11 @@ void kafka_metadata_collection_minit(INIT_FUNC_ARGS)
     INIT_NS_CLASS_ENTRY(tmpce, "RdKafka\\Metadata", "Collection", fe);
     ce = zend_register_internal_class(&tmpce);
     ce->create_object = create_object;
+#if PHP_VERSION_ID < 80100
     zend_class_implements(ce, 2, spl_ce_Countable, spl_ce_Iterator);
+#else
+    zend_class_implements(ce, 2, zend_ce_countable, zend_ce_iterator);
+#endif
 
     handlers = kafka_default_object_handlers;
     handlers.get_debug_info = get_debug_info;
From e570ef17571f22ec973094904e0854a1871bc4d1 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Fri, 10 Sep 2021 14:56:16 +0200
Subject: [PATCH] fix iterator prototype for PHP 8.1

---
 metadata_collection.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/metadata_collection.c b/metadata_collection.c
index 2d273f6..95a9210 100644
--- a/metadata_collection.c
+++ b/metadata_collection.c
@@ -113,7 +113,11 @@ static HashTable *get_debug_info(Z_RDKAFKA_OBJ *object, int *is_temp) /* {{{ */
 /* {{{ proto int RdKafka\Metadata\Collection::count()
    */
 
+#if PHP_VERSION_ID < 80100
 ZEND_BEGIN_ARG_INFO_EX(arginfo_kafka_metadata_count, 0, 0, 0)
+#else
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_kafka_metadata_count, 0, 0, IS_LONG, 0)
+#endif
 ZEND_END_ARG_INFO()
 
 PHP_METHOD(RdKafka__Metadata__Collection, count)
@@ -136,7 +140,11 @@ PHP_METHOD(RdKafka__Metadata__Collection, count)
 /* {{{ proto void RdKafka\Metadata\Collection::rewind()
    */
 
+#if PHP_VERSION_ID < 80100
 ZEND_BEGIN_ARG_INFO_EX(arginfo_kafka_metadata_rewind, 0, 0, 0)
+#else
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_kafka_metadata_rewind, 0, 0, IS_VOID, 0)
+#endif
 ZEND_END_ARG_INFO()
 
 PHP_METHOD(RdKafka__Metadata__Collection, rewind)
@@ -159,7 +167,11 @@ PHP_METHOD(RdKafka__Metadata__Collection, rewind)
 /* {{{ proto mixed RdKafka\Metadata\Collection::current()
    */
 
+#if PHP_VERSION_ID < 80100
 ZEND_BEGIN_ARG_INFO_EX(arginfo_kafka_metadata_current, 0, 0, 0)
+#else
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_kafka_metadata_current, 0, 0, IS_MIXED, 0)
+#endif
 ZEND_END_ARG_INFO()
 
 PHP_METHOD(RdKafka__Metadata__Collection, current)
@@ -187,7 +199,11 @@ PHP_METHOD(RdKafka__Metadata__Collection, current)
 /* {{{ proto mixed RdKafka\Metadata\Collection::key()
    */
 
+#if PHP_VERSION_ID < 80100
 ZEND_BEGIN_ARG_INFO_EX(arginfo_kafka_metadata_key, 0, 0, 0)
+#else
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_kafka_metadata_key, 0, 0, IS_MIXED, 0)
+#endif
 ZEND_END_ARG_INFO()
 
 PHP_METHOD(RdKafka__Metadata__Collection, key)
@@ -215,7 +231,11 @@ PHP_METHOD(RdKafka__Metadata__Collection, key)
 /* {{{ proto void RdKafka\Metadata\Collection::next()
    */
 
+#if PHP_VERSION_ID < 80100
 ZEND_BEGIN_ARG_INFO_EX(arginfo_kafka_metadata_next, 0, 0, 0)
+#else
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_kafka_metadata_next, 0, 0, IS_VOID, 0)
+#endif
 ZEND_END_ARG_INFO()
 
 PHP_METHOD(RdKafka__Metadata__Collection, next)
@@ -238,7 +258,11 @@ PHP_METHOD(RdKafka__Metadata__Collection, next)
 /* {{{ proto bool RdKafka\Metadata\Collection::valid()
    */
 
+#if PHP_VERSION_ID < 80100
 ZEND_BEGIN_ARG_INFO_EX(arginfo_kafka_metadata_valid, 0, 0, 0)
+#else
+ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_kafka_metadata_valid, 0, 0, _IS_BOOL, 0)
+#endif
 ZEND_END_ARG_INFO()
 
 PHP_METHOD(RdKafka__Metadata__Collection, valid)