-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: 1.1.2
-
Component/s: None
-
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).