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

Consider enums and traits in BSON decoding instantiatable checks

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

      PHONGO_IS_CLASS_INSTANTIATABLE is checks zend_class_entry flags and is used for two purposes:

      • When encountering a __pclass Binary field in a document, only an instantiatable class can be used as the ODM class; otherwise, it is ignored and the __pclass field will show up in the deserialized PHP document.
      • When specifying a class in a type map, it must be instantiatable or else an exception is raised.

      I came across this when implementing PHPC-2083 as I realized the macro did not consider enums nor traits. We should add both along with regression tests for all class types presently supported (e.g. abstract, interfaces).

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: