Create interface for Cursor class

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Fixed
    • Priority: Major - P3
    • 1.6.0alpha1, 1.6.0
    • Affects Version/s: 1.4.0
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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 Rethans
            Reporter:
            Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: