Skip to content

- Update MongoDB library to v2.1 and adjust Composer dependency#43

Closed
borsuk85 wants to merge 2 commits into
eMAGTechLabs:masterfrom
borsuk85:master
Closed

- Update MongoDB library to v2.1 and adjust Composer dependency#43
borsuk85 wants to merge 2 commits into
eMAGTechLabs:masterfrom
borsuk85:master

Conversation

@borsuk85

Copy link
Copy Markdown
  • 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`
Comment thread src/MongoTransport.php
}

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread composer.json Outdated
}

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

Copy link
Copy Markdown
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

iosifch commented Oct 9, 2025

Copy link
Copy Markdown
Member

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