Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-598

Clean up cursor usages to account for iterator changes

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.9.0-alpha1, 1.9.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Starting with ext-mongodb 1.9.0, MongoDB\Driver\Cursor implements the Iterator interface, which allows us to simplify some of the logic around cursors.

      In many cases, we wrap the original cursor in a IteratorIterator to call the typical iterator methods (e.g. rewind). This is no longer necessary, as it just forwards the logic to the cursor and calls the corresponding method there.

      Note that PHPLIB 1.8.0 did not bump the PHPC dependency in composer.json. This is because it is compatible with both PHPC 1.8.0 and PHPC 1.9.0. Not requiring the newer version helps reduce friction during this upgrade process, hopefully speeding up adoption of PHP 8 compatible releases. PHPLIB 1.9.0 will have to bump its PHPC dependency in order to be able to make these changes to cursor iteration.

            Assignee:
            andreas.braun@mongodb.com Andreas Braun
            Reporter:
            andreas.braun@mongodb.com Andreas Braun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: