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

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

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: 1.15.0
    • Component/s: None
    • Labels:
      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 Unassigned
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: