Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-1123

Create interface for Cursor class

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.6.0alpha1, 1.6.0
    • Affects Version/s: 1.4.0
    • Component/s: None
    • Labels:
      None

      mongodb/mongo-php-driver#754 presents a use case where a CursorInterface would come in handy.

      Users cannot extend a Cursor because (a) it's final and (b) it is Traversable but not an Iterator, so there are no methods to access its elements. While wrapping the Cursor with IteratorIterator is the preferred approach, the absence of an interface means that users cannot pass around that IteratorIterator wherever a Cursor is expected. An interface could address that.

            Assignee:
            derick Derick Rethans
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: