Skip to content

PHPC-2447: Extend Iterator interface in CustorInterface #1654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Sep 17, 2024

PHPC-2447

Making this change now will make typing changes in PHPLIB-954 much easier.

@alcaeus alcaeus requested a review from GromNaN September 17, 2024 10:20
===DONE===
<?php exit(0); ?>
--EXPECT--
bool(false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted that we already have a test that checks that CursorInterface implements Iterator.

@alcaeus alcaeus merged commit 2c91356 into mongodb:v2.x Sep 17, 2024
62 checks passed
@alcaeus alcaeus deleted the phpc-2447-cursorinterface-extends-iterator branch September 17, 2024 10:51
@GromNaN
Copy link
Member

GromNaN commented Sep 17, 2024

We need to specify that CursorInterface::key() return ?int instead of mixed.

public function key(): ?int {}

This is necessary if we want CodecCursor to accept CursorInterface instead of Cursor.

@alcaeus
Copy link
Member Author

alcaeus commented Sep 18, 2024

Ah, good point. I'll update the types in #1658.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants