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

TypeMapArrayIterator only applies type map to current()

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.3.0
    • Affects Version/s: 1.1.2
    • Component/s: None
    • Labels:
      None

      The internal TypeMapArrayIterator class implemented for PHPLIB-112 only applies the type map to current().

      Whenever this class is returned, our public API only tells users that we provide a Traversable, so this may not be a concern. That said, we may want to ensure other methods of access also apply the type map (e.g. offsetGet).

      There is also a possible concern that users could modify the ArrayIterator's contents and break the existing type map application. This could be done by using offsetSet() to assign a scalar to an element, which would fail when we attempt to route it through BSON functions to apply the type map. Again, that may not be worth addressing since modification would be outside of our existing contract (Traversable is read-only).

            Assignee:
            katherine.walker@mongodb.com Katherine Walker (Inactive)
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: