Skip to content

Conversation

@borsuk85
Copy link

  • Update Dockerfile with MongoDB extension v2.1.1
  • Implement CursorInterface mock for improved test compatibility
  • Refactor all method in MongoTransport to return \Traversable

- Update Dockerfile with MongoDB extension v2.1.1
- Implement CursorInterface mock for improved test compatibility
- Refactor `all` method in `MongoTransport` to return `\Traversable`
}

public function all(int $limit = null): iterable
public function all(int $limit = null): \Traversable
Copy link
Member

Choose a reason for hiding this comment

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

The ListableReceiverInterface is defined with iterable. Why not keeping iterable?

Copy link
Author

Choose a reason for hiding this comment

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

8.2.0 The type of iterator has been widened from Traversable to Traversable|array.

Before 8.2 should be \Traversable

Copy link
Author

Choose a reason for hiding this comment

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

MongoTransportTest uses $collection = iterator_to_array($transport->all(2));

Copy link
Member

Choose a reason for hiding this comment

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

still i don't get why MongoTransport should not respect the interface it implements.

}

/**
* Zwraca prosty kursor zgodny z MongoDB\Driver\CursorInterface,
Copy link
Member

Choose a reason for hiding this comment

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

don't forget to remove the comments

@iosifch
Copy link
Member

iosifch commented Oct 9, 2025

I decided to make a new pull request (#45) where I implemented most of the changes you made in this pull request because I had to make several more updates.

@iosifch iosifch closed this Oct 9, 2025
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