Narrow Serializable::bsonSerialize() tentative return type from array|object to array|stdClass

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Unknown
    • None
    • Affects Version/s: 1.15.0
    • Component/s: None
    • None
    • None
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      PHPC-1709 introduced a tentative array|object return type hint for Serializable::bsonSerialize(). In practice, PHPC only allows the method to return an array or stdClass instance (see: phongo_bson_encode.c).

      If possible, we should consider narrowing this return type while it's still tentative.

      This also came up in mongodb/mongo-php-library#1077 for PHPLIB-1122.

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

              Created:
              Updated:
              Resolved: