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

Refactor type map struct

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.15.0
    • Affects Version/s: None
    • Component/s: None
    • None

      The php_phongo_bson_typemap struct currently contains two members for each type map path:

      typedef struct {
      	php_phongo_bson_typemap_types document_type;
      	zend_class_entry*             document;
      	php_phongo_bson_typemap_types array_type;
      	zend_class_entry*             array;
      	php_phongo_bson_typemap_types root_type;
      	zend_class_entry*             root;
      // ...
      }
      

      This can be refactored to declare a new struct consisting of type and class members that are used instead of the current double entry. This future-proofs the type map struct for changes (one prototype for ODM deserialisation features adds a zval* to the type map) and allows better reusability of logic working with a type map element.

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

              Created:
              Updated:
              Resolved: