Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-980

Client constructor signature should be consistent with Manager

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.15.0
    • Affects Version/s: None
    • Component/s: None
    • None

      With 1b29a6d for PHPLIB-599, the prototype of the Client constructor now differs from Manager in that only the Manager constructor allows null values for each parameter.

      Note: Manager specifies check_null=true for Z_PARAM_ARRAY_EX when parsing the options arrays, so null values are supported internally. In the Client constructor, we'll likely need to replace explicit values with empty arrays since we tend to inject options (at least for driver options).

      We should consider changing this for consistency. It's quite possible that this could break existing applications that pass null to the Client constructor when they only want to specify an options array.

      I only encountered this issue with respect to the Client constructor, but it's possible there are some other edge cases from the recent type changes that I previously overlooked. I suggest we keep any eye out for those when writing the documentation in PHPLIB-601, as there may be other things we wish to change before release.

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

              Created:
              Updated:
              Resolved: