diff --git a/src/MongoDB/Cursor.c b/src/MongoDB/Cursor.c index 92b821d04..b41cb4561 100644 --- a/src/MongoDB/Cursor.c +++ b/src/MongoDB/Cursor.c @@ -438,7 +438,7 @@ static HashTable* php_phongo_cursor_get_debug_info(zend_object* object, int* is_ void php_phongo_cursor_init_ce(INIT_FUNC_ARGS) { - php_phongo_cursor_ce = register_class_MongoDB_Driver_Cursor(zend_ce_iterator, php_phongo_cursor_interface_ce); + php_phongo_cursor_ce = register_class_MongoDB_Driver_Cursor(php_phongo_cursor_interface_ce); php_phongo_cursor_ce->create_object = php_phongo_cursor_create_object; memcpy(&php_phongo_handler_cursor, phongo_get_std_object_handlers(), sizeof(zend_object_handlers)); diff --git a/src/MongoDB/Cursor.stub.php b/src/MongoDB/Cursor.stub.php index 04865eb1a..ff90b0463 100644 --- a/src/MongoDB/Cursor.stub.php +++ b/src/MongoDB/Cursor.stub.php @@ -8,7 +8,7 @@ namespace MongoDB\Driver; /** @not-serializable */ -final class Cursor implements \Iterator, CursorInterface +final class Cursor implements CursorInterface { final private function __construct() {} diff --git a/src/MongoDB/CursorInterface.c b/src/MongoDB/CursorInterface.c index 41bea92cb..27f25e05d 100644 --- a/src/MongoDB/CursorInterface.c +++ b/src/MongoDB/CursorInterface.c @@ -24,5 +24,5 @@ zend_class_entry* php_phongo_cursor_interface_ce; void php_phongo_cursor_interface_init_ce(INIT_FUNC_ARGS) { - php_phongo_cursor_interface_ce = register_class_MongoDB_Driver_CursorInterface(zend_ce_traversable); + php_phongo_cursor_interface_ce = register_class_MongoDB_Driver_CursorInterface(zend_ce_iterator); } diff --git a/src/MongoDB/CursorInterface.stub.php b/src/MongoDB/CursorInterface.stub.php index f517a733a..47e5fec6c 100644 --- a/src/MongoDB/CursorInterface.stub.php +++ b/src/MongoDB/CursorInterface.stub.php @@ -7,7 +7,7 @@ namespace MongoDB\Driver; -interface CursorInterface extends \Traversable +interface CursorInterface extends \Iterator { /** @tentative-return-type */ public function getId(): CursorId|\MongoDB\BSON\Int64; diff --git a/src/MongoDB/CursorInterface_arginfo.h b/src/MongoDB/CursorInterface_arginfo.h index 37e67d327..c4465d6ab 100644 --- a/src/MongoDB/CursorInterface_arginfo.h +++ b/src/MongoDB/CursorInterface_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 95f356a63692e1bb72d50c641e93a53113c43531 */ + * Stub hash: a349f3142a48084fd7359d202a6384b7927c2936 */ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_MongoDB_Driver_CursorInterface_getId, 0, 0, MongoDB\\Driver\\CursorId|MongoDB\\BSON\\Int64, 0) ZEND_END_ARG_INFO() @@ -29,13 +29,13 @@ static const zend_function_entry class_MongoDB_Driver_CursorInterface_methods[] ZEND_FE_END }; -static zend_class_entry *register_class_MongoDB_Driver_CursorInterface(zend_class_entry *class_entry_Traversable) +static zend_class_entry *register_class_MongoDB_Driver_CursorInterface(zend_class_entry *class_entry_Iterator) { zend_class_entry ce, *class_entry; INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver", "CursorInterface", class_MongoDB_Driver_CursorInterface_methods); class_entry = zend_register_internal_interface(&ce); - zend_class_implements(class_entry, 1, class_entry_Traversable); + zend_class_implements(class_entry, 1, class_entry_Iterator); return class_entry; } diff --git a/src/MongoDB/Cursor_arginfo.h b/src/MongoDB/Cursor_arginfo.h index 43a91e0b3..49d32f62d 100644 --- a/src/MongoDB/Cursor_arginfo.h +++ b/src/MongoDB/Cursor_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: c2927c5d481f305b1579a8968eeecc39ba921ddd */ + * Stub hash: 00390b38afb06e7361930fa5de69ca2bbfcc30d3 */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_Driver_Cursor___construct, 0, 0, 0) ZEND_END_ARG_INFO() @@ -63,14 +63,14 @@ static const zend_function_entry class_MongoDB_Driver_Cursor_methods[] = { ZEND_FE_END }; -static zend_class_entry *register_class_MongoDB_Driver_Cursor(zend_class_entry *class_entry_Iterator, zend_class_entry *class_entry_MongoDB_Driver_CursorInterface) +static zend_class_entry *register_class_MongoDB_Driver_Cursor(zend_class_entry *class_entry_MongoDB_Driver_CursorInterface) { zend_class_entry ce, *class_entry; INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver", "Cursor", class_MongoDB_Driver_Cursor_methods); class_entry = zend_register_internal_class_ex(&ce, NULL); class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NOT_SERIALIZABLE; - zend_class_implements(class_entry, 2, class_entry_Iterator, class_entry_MongoDB_Driver_CursorInterface); + zend_class_implements(class_entry, 1, class_entry_MongoDB_Driver_CursorInterface); return class_entry; } diff --git a/tests/cursor/cursorinterface-002.phpt b/tests/cursor/cursorinterface-002.phpt index 894376519..b854aa091 100644 --- a/tests/cursor/cursorinterface-002.phpt +++ b/tests/cursor/cursorinterface-002.phpt @@ -1,8 +1,8 @@ --TEST-- -MongoDB\Driver\CursorInterface extends Traversable +MongoDB\Driver\CursorInterface extends Iterator --FILE-- ===DONE=== diff --git a/tests/cursor/cursorinterface-003.phpt b/tests/cursor/cursorinterface-003.phpt deleted file mode 100644 index 7746f4162..000000000 --- a/tests/cursor/cursorinterface-003.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -MongoDB\Driver\CursorInterface does not extend Iterator ---FILE-- - -===DONE=== - ---EXPECT-- -bool(false) -===DONE===