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

Avoid multiple calls to document_to_array() during argument validation

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      This problem predates the introduction of document_to_array() in PHPLIB-1122, since is_first_key_operator() and is_pipeline() always converted their arguments to arrays.

      This issue is typical in the code path for validating update and replacement arguments, since both methods are called in succession. Ideally, we should process the array|object value once with document_to_array() and then inspect its return value.

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

              Created:
              Updated: