Refactor php_phongo_bson_state struct initialization for debug output

XMLWordPrintableJSON

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

      We frequently do the following when converting BSON to a PHP value for debug info functions:

      php_phongo_bson_state state = PHONGO_BSON_STATE_INITIALIZER;
      /* Use native arrays for debugging output */
      state.map.root_type = PHONGO_TYPEMAP_NATIVE_ARRAY;
      state.map.document_type = PHONGO_TYPEMAP_NATIVE_ARRAY;
      

      Rather than duplicate this everywhere, we should refactor this with either a macro or simply a second initializer struct (e.g. PHONGO_DEBUG_BSON_STATE_INITIALIZER).

            Assignee:
            Andreas Braun
            Reporter:
            Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: