Skip to content

PHPLIB-1522: Deprecate info iterators #1438

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
merged 4 commits into from
Sep 23, 2024

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Sep 23, 2024

PHPLIB-1522

This PR deprecates the CollectionInfoIterator, DatabaseInfoIterator, and IndexInfoIterator interfaces and implementing classes. These will be replaced with generic iterators in 2.0.

In addition to this change, this PR also deprecates IndexInfo::getNamespace. The ns field that feeds this method has been removed from output in MongoDB 4.4, and keeping the necessary code added in PHPLIB-499 around makes no sense going forward.

@alcaeus alcaeus requested a review from a team as a code owner September 23, 2024 11:52
@alcaeus alcaeus requested a review from GromNaN September 23, 2024 11:52
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

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

I would change the assertion on tests also:

$this->assertInstanceOf(DatabaseInfoIterator::class, $databases);

@alcaeus
Copy link
Member Author

alcaeus commented Sep 23, 2024

I would change the assertion on tests also:

$this->assertInstanceOf(DatabaseInfoIterator::class, $databases);

For now I'd leave in the assertion as a safe guard. We can update this in 2.x. I have added the templated return types for Psalm's benefit and updated the baseline.

Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

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

LGTM

@alcaeus alcaeus merged commit 2109214 into mongodb:v1.20 Sep 23, 2024
36 checks passed
@alcaeus alcaeus deleted the phplib-1522-deprecate-info-iterators branch September 23, 2024 13:46
This was referenced Sep 23, 2024
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