From 71a71709b538625241f85ebccfb2c3f269bd10cb Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 19 Sep 2021 21:01:29 +0200 Subject: [PATCH] Fix iterator prototypes for PHP 8.1 (#35) * Fix iterator prototypes for PHP 8.1 * Simplify previous * use ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX from phpc --- gnupg_keylistiterator.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/gnupg_keylistiterator.c b/gnupg_keylistiterator.c index 215aaa0..9b285ee 100644 --- a/gnupg_keylistiterator.c +++ b/gnupg_keylistiterator.c @@ -90,14 +90,28 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_gnupg_void_iterator_method, 0, 0, 0) ZEND_END_ARG_INFO() /* }}} */ +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_gnupg_current, 0, 0, IS_MIXED, 0) +ZEND_END_ARG_INFO() + +#define arginfo_gnupg_key arginfo_gnupg_current + +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_gnupg_valid, 0, 0, _IS_BOOL, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_gnupg_next, 0, 0, IS_VOID, 0) +ZEND_END_ARG_INFO() + +#define arginfo_gnupg_rewind arginfo_gnupg_next + + /* {{{ method list gnupg_keylistiterator */ static zend_function_entry gnupg_keylistiterator_methods[] = { PHP_ME(gnupg_keylistiterator, __construct, arginfo_gnupg_void_iterator_method, ZEND_ACC_PUBLIC) - PHP_ME(gnupg_keylistiterator, current, arginfo_gnupg_void_iterator_method, ZEND_ACC_PUBLIC) - PHP_ME(gnupg_keylistiterator, key, arginfo_gnupg_void_iterator_method, ZEND_ACC_PUBLIC) - PHP_ME(gnupg_keylistiterator, next, arginfo_gnupg_void_iterator_method, ZEND_ACC_PUBLIC) - PHP_ME(gnupg_keylistiterator, rewind, arginfo_gnupg_void_iterator_method, ZEND_ACC_PUBLIC) - PHP_ME(gnupg_keylistiterator, valid, arginfo_gnupg_void_iterator_method, ZEND_ACC_PUBLIC) + PHP_ME(gnupg_keylistiterator, current, arginfo_gnupg_current, ZEND_ACC_PUBLIC) + PHP_ME(gnupg_keylistiterator, key, arginfo_gnupg_key, ZEND_ACC_PUBLIC) + PHP_ME(gnupg_keylistiterator, next, arginfo_gnupg_next, ZEND_ACC_PUBLIC) + PHP_ME(gnupg_keylistiterator, rewind, arginfo_gnupg_rewind, ZEND_ACC_PUBLIC) + PHP_ME(gnupg_keylistiterator, valid, arginfo_gnupg_valid, ZEND_ACC_PUBLIC) PHPC_FE_END }; /* }}} */